1
0
Fork 0
mirror of https://github.com/Luzifer/git-changerelease.git synced 2024-12-20 19:11:17 +00:00
git-changerelease/assets.go

27 lines
368 B
Go
Raw Normal View History

2016-07-14 10:55:04 +00:00
package main
import (
"embed"
2016-07-14 10:55:04 +00:00
"fmt"
)
//go:embed assets/*
var assetFS embed.FS
2016-07-14 10:55:04 +00:00
func asset(name string) ([]byte, error) {
data, err := assetFS.ReadFile(name)
2016-07-14 10:55:04 +00:00
if err != nil {
return data, fmt.Errorf("reading asset: %w", err)
2016-07-14 10:55:04 +00:00
}
return data, nil
2016-07-14 10:55:04 +00:00
}
func mustAsset(name string) []byte {
data, err := asset(name)
2016-07-14 10:55:04 +00:00
if err != nil {
panic(err)
2016-07-14 10:55:04 +00:00
}
return data
2016-07-14 10:55:04 +00:00
}