gohttpserver/templates/templates.go
Jeffrey Paul 61228b4586
Some checks failed
continuous-integration/drone/push Build is failing
embed static files now (#14)
Co-authored-by: sneak <sneak@sneak.berlin>
Reviewed-on: #14
2022-11-28 00:19:47 +00:00

20 lines
284 B
Go

package templates
import (
"embed"
"strings"
)
//go:embed *.html
var Templates embed.FS
func MustString(filename string) string {
bytes, error := Templates.ReadFile(filename)
if error != nil {
panic(error)
}
var out strings.Builder
out.Write(bytes)
return out.String()
}