Author: Honza Pokorny <me@honza.ca>
Register template funcs in all scenarios Templates can be loaded from disk, or from inside the binary. We need to include the template functions in both scenarios. Fixes #1
pkg/smithy/smithy.go | 9 +++------
diff --git a/pkg/smithy/smithy.go b/pkg/smithy/smithy.go index f869da64eecec7a737db9bb27d0ad609515a2acd..52647dcc87247f7381a621419864262052c8408c 100644 --- a/pkg/smithy/smithy.go +++ b/pkg/smithy/smithy.go @@ -754,18 +754,15 @@ return cssPath }, } + t := template.New("").Funcs(funcs) + if smithyConfig.Templates.Dir != "" { if !strings.HasSuffix(smithyConfig.Templates.Dir, "*") { smithyConfig.Templates.Dir += "/*" } - templ, err := template.ParseGlob(smithyConfig.Templates.Dir) - if err != nil { - return templ, err - } - return templ.Funcs(funcs), nil + return t.ParseGlob(smithyConfig.Templates.Dir) } - t := template.New("").Funcs(funcs) statikFS, err := fs.New() if err != nil {