Skip to content

Commit 9a7fcb8

Browse files
committed
Rename infoutil.GetInfo() to info.New()
Signed-off-by: Jan Dubois <[email protected]>
1 parent a00b2a6 commit 9a7fcb8

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

cmd/limactl/info.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"encoding/json"
88
"fmt"
99

10-
"github.com/lima-vm/lima/pkg/infoutil"
10+
"github.com/lima-vm/lima/pkg/limainfo"
1111
"github.com/spf13/cobra"
1212
)
1313

@@ -23,7 +23,7 @@ func newInfoCommand() *cobra.Command {
2323
}
2424

2525
func infoAction(cmd *cobra.Command, _ []string) error {
26-
info, err := infoutil.GetInfo()
26+
info, err := limainfo.New()
2727
if err != nil {
2828
return err
2929
}

pkg/infoutil/infoutil.go renamed to pkg/limainfo/limainfo.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-FileCopyrightText: Copyright The Lima Authors
22
// SPDX-License-Identifier: Apache-2.0
33

4-
package infoutil
4+
package limainfo
55

66
import (
77
"errors"
@@ -16,7 +16,7 @@ import (
1616
"github.com/sirupsen/logrus"
1717
)
1818

19-
type Info struct {
19+
type LimaInfo struct {
2020
Version string `json:"version"`
2121
Templates []templatestore.Template `json:"templates"`
2222
DefaultTemplate *limayaml.LimaYAML `json:"defaultTemplate"`
@@ -29,7 +29,10 @@ type GuestAgent struct {
2929
Location string `json:"location"` // since Lima v1.1.0
3030
}
3131

32-
func GetInfo() (*Info, error) {
32+
// New returns a LimaInfo object with the Lima version, a list of all Templates and their location,
33+
// the DefaultTemplate corresponding to template://default with all defaults filled in, the
34+
// LimaHome location, a list of all supported VMTypes, and a map of GuestAgents for each architecture.
35+
func New() (*LimaInfo, error) {
3336
b, err := templatestore.Read(templatestore.Default)
3437
if err != nil {
3538
return nil, err
@@ -38,7 +41,7 @@ func GetInfo() (*Info, error) {
3841
if err != nil {
3942
return nil, err
4043
}
41-
info := &Info{
44+
info := &LimaInfo{
4245
Version: version.Version,
4346
DefaultTemplate: y,
4447
VMTypes: driverutil.Drivers(),

0 commit comments

Comments
 (0)