Skip to content

Commit

Permalink
fix: version flag
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasmalkmus committed Dec 20, 2022
1 parent e963e78 commit 187a35c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/tankerkoenig_exporter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ func main() {
flag.Parse()

if versionFlag {
if version.Print("tankerkoenig_exporter") != "" {
if v := version.Print("tankerkoenig_exporter"); v != "" {
fmt.Println(v)
} else if buildInfo, ok := debug.ReadBuildInfo(); ok {
fmt.Println(buildInfo.Main.Version)
} else {
Expand Down

0 comments on commit 187a35c

Please sign in to comment.