Skip to content

Commit fb24d47

Browse files
committed
pkg/templateutil -> pkg/textutil (no code change)
The previous package name was confusing. Signed-off-by: Akihiro Suda <[email protected]>
1 parent e5a79f1 commit fb24d47

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

cmd/lima-guestagent/install_systemd_linux.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"path/filepath"
99
"strings"
1010

11-
"github.com/lima-vm/lima/pkg/templateutil"
11+
"github.com/lima-vm/lima/pkg/textutil"
1212
"github.com/sirupsen/logrus"
1313
"github.com/spf13/cobra"
1414
)
@@ -68,5 +68,5 @@ func generateSystemdUnit() ([]byte, error) {
6868
m := map[string]string{
6969
"Binary": selfExeAbs,
7070
}
71-
return templateutil.Execute(systemdUnitTemplate, m)
71+
return textutil.ExecuteTemplate(systemdUnitTemplate, m)
7272
}

pkg/cidata/template.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"github.com/lima-vm/lima/pkg/iso9660util"
1212

1313
"github.com/containerd/containerd/identifiers"
14-
"github.com/lima-vm/lima/pkg/templateutil"
14+
"github.com/lima-vm/lima/pkg/textutil"
1515
)
1616

1717
//go:embed cidata.TEMPLATE.d
@@ -114,7 +114,7 @@ func ExecuteTemplate(args TemplateArgs) ([]iso9660util.Entry, error) {
114114
if err != nil {
115115
return err
116116
}
117-
b, err := templateutil.Execute(string(templateB), args)
117+
b, err := textutil.ExecuteTemplate(string(templateB), args)
118118
if err != nil {
119119
return err
120120
}

pkg/templateutil/templateutil.go renamed to pkg/textutil/textutil.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
package templateutil
1+
package textutil
22

33
import (
44
"bytes"
55
"text/template"
66
)
77

8-
func Execute(tmpl string, args interface{}) ([]byte, error) {
8+
// ExecuteTemplate executes a text/template template.
9+
func ExecuteTemplate(tmpl string, args interface{}) ([]byte, error) {
910
x, err := template.New("").Parse(tmpl)
1011
if err != nil {
1112
return nil, err

0 commit comments

Comments
 (0)