1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
package main import ( _ "embed" "log" "strings" ) //go:embed VERSION.txt var version string func init() { if version == "" { log.Fatal("Bad build: No version string embedded.") } version = strings.Trim(version, "\n") }