github.com/andrewhsu/cli/v2@v2.0.1-0.20210910131313-d4b4061f5b89/internal/build/build.go (about) 1 package build 2 3 import ( 4 "runtime/debug" 5 ) 6 7 // Version is dynamically set by the toolchain or overridden by the Makefile. 8 var Version = "DEV" 9 10 // Date is dynamically set at build time in the Makefile. 11 var Date = "" // YYYY-MM-DD 12 13 func init() { 14 if Version == "DEV" { 15 if info, ok := debug.ReadBuildInfo(); ok && info.Main.Version != "(devel)" { 16 Version = info.Main.Version 17 } 18 } 19 }