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
Knut Ahlers 810e271c3b
Modernize code, update deps, fix linter errors
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2023-11-11 15:27:37 +01:00

26 lines
368 B
Go

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