mirror of
https://github.com/onyx-and-iris/q3rcon.git
synced 2026-02-16 02:07:53 +00:00
rewrite versionFromBuild()
This commit is contained in:
parent
0fe373d1d1
commit
e4f3366a67
@ -124,14 +124,15 @@ func run() (func(), error) {
|
|||||||
|
|
||||||
// versionFromBuild retrieves the version information from the build metadata.
|
// versionFromBuild retrieves the version information from the build metadata.
|
||||||
func versionFromBuild() string {
|
func versionFromBuild() string {
|
||||||
if version == "" {
|
if version != "" {
|
||||||
info, ok := debug.ReadBuildInfo()
|
return version
|
||||||
if !ok {
|
|
||||||
return "(unable to read build info)"
|
|
||||||
}
|
|
||||||
version = strings.Split(info.Main.Version, "-")[0]
|
|
||||||
}
|
}
|
||||||
return version
|
|
||||||
|
info, ok := debug.ReadBuildInfo()
|
||||||
|
if !ok {
|
||||||
|
return "(unable to read version)"
|
||||||
|
}
|
||||||
|
return strings.Split(info.Main.Version, "-")[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
func connectRcon(host string, port int, password string) (*q3rcon.Rcon, func(), error) {
|
func connectRcon(host string, port int, password string) (*q3rcon.Rcon, func(), error) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user