19 lines
386 B
Go
19 lines
386 B
Go
package build
|
|
|
|
import (
|
|
"runtime/debug"
|
|
)
|
|
|
|
// Version is dynamically set by the toolchain or overridden by the Makefile.
|
|
var Version = "DEV"
|
|
|
|
// Date is dynamically set at build time in the Makefile.
|
|
var Date = "" // YYYY-MM-DD
|
|
|
|
func init() {
|
|
if Version == "DEV" {
|
|
if info, ok := debug.ReadBuildInfo(); ok && info.Main.Version != "(devel)" {
|
|
Version = info.Main.Version
|
|
}
|
|
}
|
|
}
|