From f0fc4e3764ee0ab649054716e372319b1a08691b Mon Sep 17 00:00:00 2001 From: xing Date: Fri, 4 Nov 2022 12:59:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/templatefs.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/templatefs.go b/templates/templatefs.go index 62e1b28..1cafee8 100644 --- a/templates/templatefs.go +++ b/templates/templatefs.go @@ -21,7 +21,7 @@ func NewFsTemplate(funcMap template.FuncMap) *FsTemplate { return &FsTemplate{FuncMap: funcMap, Templates: make(map[string]*template.Template)} } -func (t *FsTemplate) SetTemplate() *FsTemplate { +func (t FsTemplate) SetTemplate() *FsTemplate { mainTemplates, err := fs.Glob(TemplateFs, `*/*[^layout]/*.gohtml`) if err != nil { panic(err) @@ -32,7 +32,7 @@ func (t *FsTemplate) SetTemplate() *FsTemplate { base := c[0] t.Templates[include] = template.Must(template.New(name).Funcs(t.FuncMap).ParseFS(TemplateFs, include, filepath.Join(base, "layout/*.gohtml"))) } - return t + return &t } func (t FsTemplate) Instance(name string, data any) render.Render {