Skip to content

Commit

Permalink
add go version
Browse files Browse the repository at this point in the history
  • Loading branch information
keisku committed Jun 11, 2024
1 parent 21282ae commit 1fb65e9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ func (promLogger) Println(v ...interface{}) {
func main() {
flag.Parse()
if *printVersion {
var arch, goos, commitHash = "unknown", "unknown", "unknown"
var gover, arch, goos, commitHash = "unknown", "unknown", "unknown", "unknown"
if info, ok := debug.ReadBuildInfo(); ok {
gover = info.GoVersion
for _, s := range info.Settings {
switch s.Key {
case "GOARCH":
Expand All @@ -74,7 +75,7 @@ func main() {
}
}
}
fmt.Printf("gmon %s (%s/%s) commit=%s\n", Version, goos, arch, commitHash)
fmt.Printf("gmon %s (%s/%s) %s, commit=%s\n", Version, goos, arch, gover, commitHash)
return
}

Expand Down

0 comments on commit 1fb65e9

Please sign in to comment.