Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ExitCode int
ExitCode is a global variable that is intended to be used by CLI commands to hold the current exit code and subsequently used in ExitWithCodeIfNonZero.
Functions ¶
func ExitWithCodeIfNonZero ¶ added in v0.1.2
ExitWithCodeIfNonZero is a helper function that is intended to be used as a PostRun function for a cobra command. It checks if the exitCode variable is non-zero and exits the program with the global ExitCode value.
func GoOnExitSignal ¶
GoOnExitSignal calls the given callback when the process receives an interrupt or terminate signal. It sets up a goroutine that listens for OS signals and invokes the callback
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.