diff --git a/template/builder.go b/template/builder.go index 1674432f7a8ea0cf96c1b9f78295e4f4bf6a9104..a92e8ca3a39a3a9e4865d60f58efb535681f1693 100644 --- a/template/builder.go +++ b/template/builder.go @@ -3,9 +3,9 @@ package template import ( "bytes" "context" - templhtml "html/template" + html "html/template" "io" - templtext "text/template" + text "text/template" "git.perx.ru/perxis/perxis-go/pkg/collections" "git.perx.ru/perxis/perxis-go/pkg/content" @@ -18,7 +18,7 @@ type Template interface { } type Builder struct { - parseFunc func(text string) (Template, error) + parseFunc func(data string) (Template, error) ctx context.Context cnt *content.Content @@ -41,8 +41,8 @@ func NewBuilder(cnt *content.Content, space, env, col string) Builder { EnvID: env, CollID: col, } - b.parseFunc = func(text string) (Template, error) { - return templtext.New("main_text").Funcs(b.getFuncs()).Parse(text) + b.parseFunc = func(data string) (Template, error) { + return text.New("main_text").Funcs(b.getFuncs()).Parse(data) } return b } @@ -55,8 +55,8 @@ func NewHTMLBuilder(cnt *content.Content, space, env, col string) Builder { EnvID: env, CollID: col, } - b.parseFunc = func(text string) (Template, error) { - return templhtml.New("main_html").Funcs(b.getFuncs()).Parse(text) + b.parseFunc = func(data string) (Template, error) { + return html.New("main_html").Funcs(b.getFuncs()).Parse(data) } return b }