Files
cloud-ip-validator/internal/dashboard/embed.go
T

23 lines
497 B
Go
Raw Normal View History

2026-08-23 20:39:22 +03:00
package dashboard
import (
"embed"
"io/fs"
)
//go:embed templates/*.html
var templateFS embed.FS
//go:embed static
var staticFS embed.FS
// staticSubFS re-roots staticFS so "static/dashboard.css" is served as
// "/dashboard.css" under the /static/ route prefix, instead of
// "/static/static/dashboard.css".
func staticSubFS() fs.FS {
sub, err := fs.Sub(staticFS, "static")
if err != nil {
panic(err) // embedded at compile time; a bad path here can't happen at runtime
}
return sub
}