Documentation ¶
Overview ¶
replacement for os.Exit(N) that runs defers
Original article: http://soniacodes.wordpress.com/2011/04/28/deferred-functions-and-an-exit-code/
This is modified version to pass an integer status to os.Exit ¶
usage: as the first line of main add:
defer exitwithstatus.HandleFatal()
to exit with a particular integer value:
exitwithstatus.Exit(42)
Index ¶
Constants ¶
View Source
const ( Major = "0" Minor = "1" Patch = "2" Version = Major + "." + Minor + "." + Patch )
ensure that git has a tag: "vX.Y.Z" corresponding to major, minor and patch
Variables ¶
This section is empty.
Functions ¶
func Exit ¶
func Exit(status int)
Exit with the integer status value
e.g to exit calling all defers with the value three: exitwithstatus.Exit(3)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.