Skip to content

Commit

Permalink
change version command default behaviour
Browse files Browse the repository at this point in the history
this allows for slightly clearer output when using go install
  • Loading branch information
stefanotorresi committed Dec 20, 2024
1 parent c30db92 commit 5bf64a8
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (

var (
// the released version
version string
version string = "development"
// the time the binary was built
buildDate string
buildDate string = "at unknown time"
// global --help flag
helpFlag *bool
// global --version flag
Expand Down Expand Up @@ -105,9 +105,6 @@ func showHelp() {
}

func showVersion() {
if buildDate == "" {
buildDate = "at unknown time"
}
fmt.Printf("version %s\nbuilt with %s %s/%s %s\n", version, runtime.Version(), runtime.GOOS, runtime.GOARCH, buildDate)
fmt.Printf("%s version\nbuilt with %s %s/%s %s\n", version, runtime.Version(), runtime.GOOS, runtime.GOARCH, buildDate)
os.Exit(0)
}

0 comments on commit 5bf64a8

Please sign in to comment.