Skip to content

Commit

Permalink
add go version to version command (rebuy-de#800)
Browse files Browse the repository at this point in the history
  • Loading branch information
svenwltr authored May 18, 2022
1 parent 7195ac9 commit 357aa44
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cmd

import (
"fmt"
"runtime/debug"

"github.com/spf13/cobra"
)
Expand All @@ -22,6 +23,11 @@ func NewVersionCommand() *cobra.Command {
fmt.Printf("build date: %s\n", BuildDate)
fmt.Printf("scm hash: %s\n", BuildHash)
fmt.Printf("environment: %s\n", BuildEnvironment)

bi, ok := debug.ReadBuildInfo()
if ok && bi != nil {
fmt.Printf("go version: %s\n", bi.GoVersion)
}
},
}

Expand Down

0 comments on commit 357aa44

Please sign in to comment.