If I compile this program
package main import ( "fmt" "os" ) var version = os.Getenv("VERSION") func main() { fmt.Println(version) }
It prints env var when I run it
VERSION="0.123" ./example > 0.123
Is there a way to compile env var into a binary, for example:
VERSION="0.123" go build example.go
Then get the same output at startup
./example
go
mozey
source share