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{
|
kong.Vars{
|
||||||
"version": func() string {
|
"version": func() 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]
|
||||||
}(),
|
}(),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user