tube/templates/templates.go
gabek 29f2784591 Replace rice box with go embed (#25)
Reviewed-on: https://git.mills.io/prologic/tube/pulls/25
Co-authored-by: gabek <gabek@noreply@mills.io>
Co-committed-by: gabek <gabek@noreply@mills.io>
2022-08-30 01:17:08 +00:00

17 lines
280 B
Go

package templates
import (
"embed"
)
//go:embed *.html
var templates embed.FS
// MustGetTemplate returns a template string with the given name.
func MustGetTemplate(name string) string {
b, err := templates.ReadFile(name)
if err != nil {
panic(err)
}
return string(b)
}