rewrite versionFromBuild()

This commit is contained in:
onyx-and-iris 2026-02-16 01:26:12 +00:00
parent 0fe373d1d1
commit e4f3366a67

View File

@ -124,14 +124,15 @@ func run() (func(), error) {
// versionFromBuild retrieves the version information from the build metadata.
func versionFromBuild() string {
if version == "" {
if version != "" {
return version
}
info, ok := debug.ReadBuildInfo()
if !ok {
return "(unable to read build info)"
return "(unable to read version)"
}
version = strings.Split(info.Main.Version, "-")[0]
}
return version
return strings.Split(info.Main.Version, "-")[0]
}
func connectRcon(host string, port int, password string) (*q3rcon.Rcon, func(), error) {