davecheney / httpstat

It's like curl -v, with colours.
MIT License
7.07k stars 385 forks source link

os.Exit used in flag.Usage #105

Closed Luit closed 8 years ago

Luit commented 8 years ago

By coincidence I read through this code, and shortly after that read Idiomatic Go. There was one practice highlighted there that I had just seen in this code.

In flag.Usage os.Exit(2) is called, which flag.Parse already does. It would be nicer to do this within the if len(args) != 1 instead of within func usage().