first go:embed 1.16 implementation
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package settings
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"io/fs"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
//go:embed assets/*
|
||||
var assets embed.FS
|
||||
|
||||
// Assets FS
|
||||
var Assets http.FileSystem
|
||||
|
||||
func init() {
|
||||
embedFS, err := fs.Sub(assets, "assets")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
Assets = http.FS(embedFS)
|
||||
}
|
||||
Reference in New Issue
Block a user