From 7e32ff6f9149502a51573c34cec21289db42363f Mon Sep 17 00:00:00 2001 From: "Felipe M." Date: Fri, 4 Apr 2025 18:45:21 +0200 Subject: [PATCH] fix: use fs.FS instead of embed.FS as argument --- template/engine.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/template/engine.go b/template/engine.go index 53414d3..13bf561 100644 --- a/template/engine.go +++ b/template/engine.go @@ -2,9 +2,9 @@ package template import ( "bytes" - "embed" "fmt" "html/template" + "io/fs" ) // Engine is a template engine @@ -24,7 +24,7 @@ func (e *Engine) Render(name string, data any) ([]byte, error) { } // NewTemplateEngine creates a new template engine from the given templates -func NewEngine(templates embed.FS) (*Engine, error) { +func NewEngine(templates fs.FS) (*Engine, error) { tmpls, err := template.ParseFS(templates, "**/*.html") if err != nil { return nil, fmt.Errorf("failed to parse templates: %w", err)