mercredi 9 novembre 2016

How to test os.Exit(0) scenarios in Go

After checking this post, I know how to test os.Exit(1) following the instruction written in that post , but I think 1 means something went wrong. When I change 1 to 0, The method in that post seems not working anymore. it gives me the error process ran with err <nil>, want exit status 0

Why I want to change os.Exit(1) to os.Exit(0):

Because when I input the command ./app -v, I want it to display the version and stop immediately with exit status 0, I don't want to treat it as a bad command with exit status 1.

when I input the command ./app, it just works like a long running process.

Aucun commentaire:

Enregistrer un commentaire