Documentation ¶
Index ¶
- Variables
- func AtExit(f ExitFunc)
- func Check(err error, message string)
- func CheckPanic(err error, message string)
- func CheckPanice(err error)
- func CheckPanicf(err error, format string, args ...interface{})
- func Checke(err error)
- func Checkf(err error, format string, args ...interface{})
- func Debug(message string)
- func Debugf(format string, args ...interface{})
- func Dump(prefix string, object interface{})
- func Exit(success bool)
- func ExitFailure()
- func ExitSuccess()
- func ExitWithStatus(status int)
- func Fatal(message string)
- func Fatalf(format string, args ...interface{})
- func GetBinEnv(suffix string) string
- func GetSourceInfo() (string, int)
- func MustGetBinName() string
- func MustGetExecutable() string
- func MustGetHome() string
- func MustGetenv(name string) string
- func OrFatalf(condition bool, format string, args ...interface{})
- func OrPanicf(condition bool, format string, args ...interface{})
- func OrWarnf(condition bool, format string, args ...interface{})
- func Panicf(format string, args ...interface{})
- func RunAndExit(f func() int)
- func RunAndExitIfFailure(f func() int)
- func RunAtExits()
- func Verbose(message string)
- func Verbosef(format string, args ...interface{})
- func Warn(message string)
- func Warnf(format string, args ...interface{})
- type ExitFunc
Constants ¶
This section is empty.
Variables ¶
var ( Quiet = false DebugEnabled = false VerboseEnabled = false )
Functions ¶
func CheckPanic ¶
func CheckPanice ¶
func CheckPanice(err error)
func CheckPanicf ¶
func Exit ¶
func Exit(success bool)
Exit should be used within RunAndExit to cleanly finishes the process.
func ExitFailure ¶
func ExitFailure()
ExitFailure should be used within RunAndExit to cleanly finishes the process with a failure code.
func ExitSuccess ¶
func ExitSuccess()
ExitSuccess should be used within RunAndExit to cleanly finishes the process with a success code.
func ExitWithStatus ¶
func ExitWithStatus(status int)
ExitWithStatus should be used within RunAndExit to cleanly finishes the process with a given status code.
func GetSourceInfo ¶
func MustGetBinName ¶
func MustGetBinName() string
MustGetBinName returns the filename of the currently running executable.
func MustGetExecutable ¶
func MustGetExecutable() string
MustGetExecutable returns the filename of the self binary.
func MustGetenv ¶
func RunAndExit ¶
func RunAndExit(f func() int)
RunAndExit executes a given function. Within the function, util.Exit* functions can be used to finish the process cleanly.
func RunAndExitIfFailure ¶
func RunAndExitIfFailure(f func() int)
RunAndExitIfFailure executes a given function. Within the function, util.Exit* functions can be used to finish the process cleanly. When f returns 0, then this fucntion will *not* call exit(1).
func RunAtExits ¶
func RunAtExits()
RunAtExits runs (and removes) all registered AtExit functions. RunAndExit will call it automatically, so no need to call it when you use RunAndExit.