mirror of
https://github.com/onyx-and-iris/vbantxt.git
synced 2026-03-02 16:19:14 +00:00
rewrite versionFromBuild()
This commit is contained in:
parent
5485927311
commit
754369668b
@ -151,14 +151,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]
|
||||||
}
|
}
|
||||||
|
|
||||||
// createClient creates a new vban client with the provided options.
|
// createClient creates a new vban client with the provided options.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user