1
0
dwelling-home/web/web.go

20 lines
285 B
Go
Raw Permalink Normal View History

2023-01-16 05:24:07 +04:00
package web
import (
"embed"
"io/fs"
"net/http"
)
//go:embed assets
var assetsDir embed.FS
func Assets() http.FileSystem {
f, _ := fs.Sub(assetsDir, "assets")
return http.FS(f)
}
func AssetsGetFile(path string) ([]byte, error) {
return assetsDir.ReadFile("assets/" + path)
}