GoTomato/internal/metadata/version.go

26 lines
326 B
Go
Raw Normal View History

package metadata
import (
2024-11-09 18:14:48 +00:00
"runtime/debug"
)
var (
2024-11-09 18:14:48 +00:00
version = ""
ProtocolVersion = "0"
)
func init() {
2024-11-09 18:14:48 +00:00
info, ok := debug.ReadBuildInfo()
if !ok || info.Main.Version == "" {
version = "unknown"
} else {
if version == "" {
version = info.Main.Version
}
}
2024-11-09 18:14:48 +00:00
}
func GetVersion() string {
return version
}