davecheney / httpstat

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

os.Exit used in flag.Usage #105

Closed Luit closed 7 years ago

Luit commented 7 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().