GoTomato/internal/metadata/version.go
2024-11-09 19:14:48 +01:00

25 lines
326 B
Go

package metadata
import (
"runtime/debug"
)
var (
version = ""
ProtocolVersion = "0"
)
func init() {
info, ok := debug.ReadBuildInfo()
if !ok || info.Main.Version == "" {
version = "unknown"
} else {
if version == "" {
version = info.Main.Version
}
}
}
func GetVersion() string {
return version
}