snow/storage/embeds.go

20 lines
240 B
Go
Raw Normal View History

2023-11-08 22:09:08 +00:00
package storage
import (
"embed"
"strings"
)
var (
2023-11-09 18:42:28 +00:00
//go:embed mem/*
2023-11-08 22:09:08 +00:00
Assets embed.FS
)
func Asset(file string) (*[]byte) {
2023-11-09 18:42:28 +00:00
data, err := Assets.ReadFile("mem/" + strings.ToLower(file))
2023-11-08 22:09:08 +00:00
if err != nil {
return nil
}
return &data
}