mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-13 18:57:18 +03:00
* Use new embed functionality for serving UI assets * Use new embed functionality for serving resources. Remove dependency on go-bindata * Remove Go 1.15
23 lines
285 B
Go
23 lines
285 B
Go
package resources
|
|
|
|
import (
|
|
"embed"
|
|
"io/fs"
|
|
"io/ioutil"
|
|
)
|
|
|
|
//go:embed *
|
|
var filesystem embed.FS
|
|
|
|
func Asset(path string) ([]byte, error) {
|
|
f, err := filesystem.Open(path)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ioutil.ReadAll(f)
|
|
}
|
|
|
|
func Assets() fs.FS {
|
|
return filesystem
|
|
}
|