moving this to use uber/fx di framework instead of the ad hoc di setup before Co-authored-by: sneak <sneak@sneak.berlin> Reviewed-on: #17
This commit was merged in pull request #17.
This commit is contained in:
1 parent
0c3797ec30
commit
dd778174a7
31 files changed
+924
-528
No files matched your search
+12
-2
@@ -2,12 +2,21 @@ package templates
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"strings"
|
||||
"text/template"
|
||||
)
|
||||
|
||||
//go:embed *.html
|
||||
var Templates embed.FS
|
||||
var TemplatesRaw embed.FS
|
||||
var TemplatesParsed *template.Template
|
||||
|
||||
func GetParsed() *template.Template {
|
||||
if TemplatesParsed == nil {
|
||||
TemplatesParsed = template.Must(template.ParseFS(TemplatesRaw, "*"))
|
||||
}
|
||||
return TemplatesParsed
|
||||
}
|
||||
|
||||
/*
|
||||
func MustString(filename string) string {
|
||||
bytes, error := Templates.ReadFile(filename)
|
||||
if error != nil {
|
||||
@@ -17,3 +26,4 @@ func MustString(filename string) string {
|
||||
out.Write(bytes)
|
||||
return out.String()
|
||||
}
|
||||
*/
|
||||
Reference in new issue
Block a user