mirror of
https://github.com/MengMengCode/VoCat.git
synced 2026-08-13 03:13:43 +08:00
21 lines
313 B
Go
21 lines
313 B
Go
package web
|
|
|
|
import (
|
|
"embed"
|
|
"io/fs"
|
|
)
|
|
|
|
//go:embed dist
|
|
var assets embed.FS
|
|
|
|
// Dist is rooted at the generated Vite distribution directory.
|
|
var Dist fs.FS = mustSub(assets, "dist")
|
|
|
|
func mustSub(source fs.FS, dir string) fs.FS {
|
|
sub, err := fs.Sub(source, dir)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return sub
|
|
}
|