22 lines
268 B
Go
22 lines
268 B
Go
package webassets
|
|
|
|
import (
|
|
"embed"
|
|
"io/fs"
|
|
)
|
|
|
|
//go:embed static
|
|
var embeddedFiles embed.FS
|
|
|
|
func StaticFS() fs.FS {
|
|
return mustSub("static")
|
|
}
|
|
|
|
func mustSub(dir string) fs.FS {
|
|
sub, err := fs.Sub(embeddedFiles, dir)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return sub
|
|
}
|