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().
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 withinfunc usage()
.