29f2784591
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>
17 lines
280 B
Go
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)
|
|
}
|