You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found usages of os.Exit in cmd/s2i/main.go.
That's a bad idea because it interrupts the runtime without running any deferred calls, no cleanup is done...
Most offenders call os.Exit indirectly through checkErr.
Also, the project is stuffing all CLI code in a single file, not following the standards we use in Origin.
To tone down the problem, there seems to be only a single defer statement to close a file that doesn't get executed in case of errors and checkErr calling os.Exit. Not the end of the world.
Still, looks like a beneficial cleanup to build on the ideas of the cobra usage in hugo.
Activity
rhcarvalho commentedon Apr 11, 2016
I'm intending to use
RunEas Hugo uses: https://github.com/spf13/cobra#alternative-error-handlingrhcarvalho commentedon Apr 12, 2016
To tone down the problem, there seems to be only a single
deferstatement to close a file that doesn't get executed in case of errors andcheckErrcallingos.Exit. Not the end of the world.Still, looks like a beneficial cleanup to build on the ideas of the cobra usage in hugo.
[-]Evil os.Exit[/-][+]Refactor CLI code and usage of os.Exit[/+]