Small refactorings
This commit is contained in:
+2
-7
@@ -2,21 +2,16 @@ package resources
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"io/fs"
|
||||
"io/ioutil"
|
||||
)
|
||||
|
||||
//go:embed *
|
||||
var filesystem embed.FS
|
||||
var FS embed.FS
|
||||
|
||||
func Asset(path string) ([]byte, error) {
|
||||
f, err := filesystem.Open(path)
|
||||
f, err := FS.Open(path)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return ioutil.ReadAll(f)
|
||||
}
|
||||
|
||||
func Assets() fs.FS {
|
||||
return filesystem
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user