diff --git a/config/global.go b/config/global.go index dc54847..f2c515e 100644 --- a/config/global.go +++ b/config/global.go @@ -6,4 +6,11 @@ import "time" const ShowDebugLog = false // Version will show in help message to distinguish different builds. -var Version = "dev-" + time.Now().Format(time.DateOnly) +// Use -ldflags="-X github.com/fumiama/WireGold/config.Version=x.y.z" to override. +var Version = "dev" + +func init() { + if Version == "dev" { + Version = "dev-" + time.Now().Format(time.DateOnly) + } +}