mirror of
https://github.com/spf13/cobra
synced 2024-11-24 22:57:12 +00:00
cmd: Make tmpl local variable
Fix CircleCI tests
This commit is contained in:
parent
c0bd07d7ba
commit
d236d29810
1 changed files with 1 additions and 4 deletions
|
@ -83,11 +83,8 @@ func exists(path string) bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
var tmpl = template.New("").Funcs(template.FuncMap{"comment": commentifyString})
|
|
||||||
|
|
||||||
func executeTemplate(tmplStr string, data interface{}) (string, error) {
|
func executeTemplate(tmplStr string, data interface{}) (string, error) {
|
||||||
var err error
|
tmpl, err := template.New("").Funcs(template.FuncMap{"comment": commentifyString}).Parse(tmplStr)
|
||||||
tmpl, err = tmpl.Parse(tmplStr)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue