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 }