2018-03-12 22:57:10 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
// Version is the build version
|
|
|
|
var Version string
|
|
|
|
|
|
|
|
// GitTag is the git tag of the build
|
|
|
|
var GitTag string
|
|
|
|
|
|
|
|
// BuildDate is the date when the build was created
|
|
|
|
var BuildDate string
|
2020-06-19 09:28:01 +01:00
|
|
|
|
|
|
|
// prepareVersionInfo sets some runtime version when the version value
|
|
|
|
// was not injected by the build into the binary (e.g. go get).
|
|
|
|
// This returns currently "(devel)" but not an effective version until
|
|
|
|
// https://github.com/golang/go/issues/29814 gets resolved.
|
|
|
|
func prepareVersionInfo() {
|
|
|
|
if Version == "" {
|
2020-06-25 14:26:15 +01:00
|
|
|
// bi, _ := debug.ReadBuildInfo()
|
|
|
|
// Version = bi.Main.Version
|
|
|
|
// TODO use the debug information when it will provide more details
|
|
|
|
// It seems to panic with Go 1.13.
|
|
|
|
Version = "dev"
|
2020-06-19 09:28:01 +01:00
|
|
|
}
|
|
|
|
}
|