mirror of
https://github.com/Luzifer/git-changerelease.git
synced 2024-12-20 19:11:17 +00:00
26 lines
368 B
Go
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
|
|
}
|