diff options
author | René 'Necoro' Neumann <necoro@necoro.eu> | 2021-02-21 17:57:40 +0100 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.eu> | 2021-02-21 17:57:40 +0100 |
commit | 5ad87a4994e241b9d6b981659b7bd0ddf5f7ce31 (patch) | |
tree | 7efd40600ea8e9e640d6b7aba93a5ff3d4e11b48 /internal/feed/template/template.go | |
parent | 48c40ede273bec2f53dd8164db46f902a0b527c8 (diff) | |
parent | 2df7f561b6a4977051499731740aae2138c9d001 (diff) | |
download | feed2imap-go-5ad87a4994e241b9d6b981659b7bd0ddf5f7ce31.tar.gz feed2imap-go-5ad87a4994e241b9d6b981659b7bd0ddf5f7ce31.tar.bz2 feed2imap-go-5ad87a4994e241b9d6b981659b7bd0ddf5f7ce31.zip |
Merge branch 'go-1.16'
Diffstat (limited to '')
-rw-r--r-- | internal/feed/template/template.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/internal/feed/template/template.go b/internal/feed/template/template.go index d8eb850..9804190 100644 --- a/internal/feed/template/template.go +++ b/internal/feed/template/template.go @@ -1,6 +1,7 @@ package template import ( + _ "embed" "fmt" html "html/template" "io" @@ -15,6 +16,15 @@ type Template interface { Execute(wr io.Writer, data interface{}) error } +//go:embed html.tpl +var htmlTpl string + +//go:embed text.tpl +var textTpl string + +var Html = fromString("Feed", htmlTpl, true) +var Text = fromString("Feed", textTpl, false) + func must(t Template, err error) Template { if err != nil { panic(err) |