diff --git a/version.go b/version.go index 70e2c7a..0e2fbee 100644 --- a/version.go +++ b/version.go @@ -1,6 +1,20 @@ package main -const ( - goVersion = "1.16.5" - hotbuildVersion = "v1.0.3" +import ( + "log" + "os" ) + +var goVersion = "1.16.5" +var Version = "" + +func init() { + if Version == "" { + v, err := os.ReadFile("./version.txt") + if err != nil { + log.Printf("read ./version.txt failed: %v", err) + return + } + Version = string(v) + } +}