fupstatic: init embedding package

This commit is contained in:
Luke Granger-Brown 2021-03-20 19:52:10 +00:00
parent 2104261536
commit 38d9449777

View file

@ -0,0 +1,23 @@
package fupstatic
import (
"embed"
"io/fs"
)
//go:embed css js
var static embed.FS
var Static fs.FS = newStaticFS(static)
//go:embed tmpl
var templates embed.FS
var Templates fs.FS = must(fs.Sub(templates, "tmpl"))
func must(fsys fs.FS, err error) fs.FS {
if err != nil {
panic(err)
}
return fsys
}