Skip to content

Commit

Permalink
Merge pull request #36 from ahrtr/fix_version_error
Browse files Browse the repository at this point in the history
`gofail --version` should exit with 0
  • Loading branch information
ahrtr authored Nov 20, 2022
2 parents dc004b5 + e6d0b93 commit 51e235e
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions gofail.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,7 @@ func main() {
case "disable":
xfrm = code.ToComments
case "--version":
fmt.Println("Git SHA: ", GitSHA)
fmt.Println("Go Version: ", runtime.Version())
fmt.Println("gofail Version: ", Version)
fmt.Printf("Go OS/Arch: %s/%s\n", runtime.GOOS, runtime.GOARCH)
os.Exit(1)
showVersion()
default:
fmt.Println(usageLine)
os.Exit(1)
Expand Down Expand Up @@ -217,3 +213,11 @@ func main() {
}
}
}

func showVersion() {
fmt.Println("Git SHA: ", GitSHA)
fmt.Println("Go Version: ", runtime.Version())
fmt.Println("gofail Version: ", Version)
fmt.Printf("Go OS/Arch: %s/%s\n", runtime.GOOS, runtime.GOARCH)
os.Exit(0)
}

0 comments on commit 51e235e

Please sign in to comment.