diff options
Diffstat (limited to 'echo/tplfuncs/embed_csp.go')
-rw-r--r-- | echo/tplfuncs/embed_csp.go | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/echo/tplfuncs/embed_csp.go b/echo/tplfuncs/embed_csp.go index 44930c4..840714a 100644 --- a/echo/tplfuncs/embed_csp.go +++ b/echo/tplfuncs/embed_csp.go | |||
@@ -3,7 +3,6 @@ package tplfuncs | |||
3 | import ( | 3 | import ( |
4 | "fmt" | 4 | "fmt" |
5 | "html/template" | 5 | "html/template" |
6 | "io" | ||
7 | "io/fs" | 6 | "io/fs" |
8 | "path" | 7 | "path" |
9 | 8 | ||
@@ -25,13 +24,7 @@ func (t *TemplateEmbeder) Embed(filename string) ([]byte, error) { | |||
25 | return nil, fmt.Errorf("EmbedWithCSP: has not been setup with template store") | 24 | return nil, fmt.Errorf("EmbedWithCSP: has not been setup with template store") |
26 | } | 25 | } |
27 | 26 | ||
28 | fd, err := t.templateStore.Open(filename) | 27 | fc, err := fs.ReadFile(t.templateStore, filename) |
29 | if err != nil { | ||
30 | return nil, err | ||
31 | } | ||
32 | defer fd.Close() | ||
33 | |||
34 | fc, err := io.ReadAll(fd) | ||
35 | if err != nil { | 28 | if err != nil { |
36 | return nil, err | 29 | return nil, err |
37 | } | 30 | } |