diff --git a/VERSION b/VERSION index 10c0880..6a126f4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.7.4 +1.7.5 diff --git a/birdwatcher.go b/birdwatcher.go index ac55877..b86a4be 100644 --- a/birdwatcher.go +++ b/birdwatcher.go @@ -12,6 +12,9 @@ import ( "github.com/julienschmidt/httprouter" ) +//go:generate versionize +var VERSION = "1.7.5" + func isModuleEnabled(module string, modulesEnabled []string) bool { for _, enabled := range modulesEnabled { if enabled == module { @@ -93,6 +96,7 @@ func main() { bird6 := flag.Bool("6", false, "Use bird6 instead of bird") flag.Parse() + endpoints.VERSION = VERSION bird.InstallRateLimitReset() // Load configurations conf, err := LoadConfigs([]string{ diff --git a/endpoints/utils.go b/endpoints/utils.go index 1bf3b41..904c4ed 100644 --- a/endpoints/utils.go +++ b/endpoints/utils.go @@ -17,10 +17,13 @@ type APIInfo struct { CacheStatus CacheStatus `json:"cache_status"` } +// go generate does not work in subdirectories. Beautious. +var VERSION string + func GetApiInfo(from_cache bool) *APIInfo { ai := &APIInfo{} - ai.Version = "1.0" + ai.Version = VERSION ai.ResultFromCache = from_cache return ai