From 0eb381413ec04ec6499996ee45cb71cbc6d465d9 Mon Sep 17 00:00:00 2001 From: xushiwei Date: Sat, 20 Jan 2024 00:36:35 +0800 Subject: [PATCH] templ: use p.yapFS() to init --- yap.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yap.go b/yap.go index 953f16a..23ca608 100644 --- a/yap.go +++ b/yap.go @@ -113,12 +113,13 @@ func (p *Engine) Run(addr string, mws ...func(h http.Handler) http.Handler) erro } func (p *Engine) templ(path string) (t Template, err error) { + fsys := p.yapFS() if p.tpls == nil { return Template{}, os.ErrNotExist } t, ok := p.tpls[path] if !ok { - t, err = ParseFSFile(p.fs, path+"_yap.html") + t, err = ParseFSFile(fsys, path+"_yap.html") if err != nil { return }