File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -17,20 +17,20 @@ import (
1717)
1818
1919// Version is dynamically set by the toolchain or overriden by the Makefile.
20- var Version = func (info * debug.BuildInfo , ok bool ) string {
21- if ! ok {
22- return "(devel)"
23- }
24- return info .Main .Version
25- }(debug .ReadBuildInfo ())
20+ var Version = "DEV"
2621
2722// BuildDate is dynamically set at build time in the Makefile.
2823var BuildDate = "" // YYYY-MM-DD
2924
3025var versionOutput = ""
3126
3227func init () {
33- Version = strings .TrimPrefix (info .Main .Version , "v" )
28+ if Version == "DEV" {
29+ if info , ok := debug .ReadBuildInfo (); ok && info .Main .Version != "(devel)" {
30+ Version = info .Main .Version
31+ }
32+ }
33+ Version = strings .TrimPrefix (Version , "v" )
3434 if BuildDate == "" {
3535 RootCmd .Version = Version
3636 } else {
You can’t perform that action at this time.
0 commit comments