mirror of
https://github.com/onyx-and-iris/gobs-cli.git
synced 2026-02-16 01:47:48 +00:00
rewrite version func
This commit is contained in:
parent
1614194cbd
commit
626600e32a
15
main.go
15
main.go
@ -116,14 +116,15 @@ func main() {
|
||||
}),
|
||||
kong.Vars{
|
||||
"version": func() string {
|
||||
if version == "" {
|
||||
info, ok := debug.ReadBuildInfo()
|
||||
if !ok {
|
||||
return "(unable to read build info)"
|
||||
}
|
||||
version = strings.Split(info.Main.Version, "-")[0]
|
||||
if version != "" {
|
||||
return version
|
||||
}
|
||||
return version
|
||||
|
||||
info, ok := debug.ReadBuildInfo()
|
||||
if !ok {
|
||||
return "(unable to read version)"
|
||||
}
|
||||
return strings.Split(info.Main.Version, "-")[0]
|
||||
}(),
|
||||
},
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user