Skip to content
Snippets Groups Projects
Commit 9841fc37 authored by Semyon Krestyaninov's avatar Semyon Krestyaninov :dog2:
Browse files

fix

parent 223f3fee
No related branches found
No related tags found
No related merge requests found
...@@ -3,9 +3,9 @@ package template ...@@ -3,9 +3,9 @@ package template
import ( import (
"bytes" "bytes"
"context" "context"
templhtml "html/template" html "html/template"
"io" "io"
templtext "text/template" text "text/template"
"git.perx.ru/perxis/perxis-go/pkg/collections" "git.perx.ru/perxis/perxis-go/pkg/collections"
"git.perx.ru/perxis/perxis-go/pkg/content" "git.perx.ru/perxis/perxis-go/pkg/content"
...@@ -18,7 +18,7 @@ type Template interface { ...@@ -18,7 +18,7 @@ type Template interface {
} }
type Builder struct { type Builder struct {
parseFunc func(text string) (Template, error) parseFunc func(data string) (Template, error)
ctx context.Context ctx context.Context
cnt *content.Content cnt *content.Content
...@@ -41,8 +41,8 @@ func NewBuilder(cnt *content.Content, space, env, col string) Builder { ...@@ -41,8 +41,8 @@ func NewBuilder(cnt *content.Content, space, env, col string) Builder {
EnvID: env, EnvID: env,
CollID: col, CollID: col,
} }
b.parseFunc = func(text string) (Template, error) { b.parseFunc = func(data string) (Template, error) {
return templtext.New("main_text").Funcs(b.getFuncs()).Parse(text) return text.New("main_text").Funcs(b.getFuncs()).Parse(data)
} }
return b return b
} }
...@@ -55,8 +55,8 @@ func NewHTMLBuilder(cnt *content.Content, space, env, col string) Builder { ...@@ -55,8 +55,8 @@ func NewHTMLBuilder(cnt *content.Content, space, env, col string) Builder {
EnvID: env, EnvID: env,
CollID: col, CollID: col,
} }
b.parseFunc = func(text string) (Template, error) { b.parseFunc = func(data string) (Template, error) {
return templhtml.New("main_html").Funcs(b.getFuncs()).Parse(text) return html.New("main_html").Funcs(b.getFuncs()).Parse(data)
} }
return b return b
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment