atexit

package
v1.18.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 28, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const ExitHandlerPanicMessage = "At least on exit handler vetoed to exit program execution"

Variables

This section is empty.

Functions

func ClearExitHandler

func ClearExitHandler()

ClearExitHandler clears all registered exit handlers

func Exit

func Exit(code int)

Exit runs all registered exit handlers and then exits the program with the specified exit code using os.Exit.

func ExitWithMessage

func ExitWithMessage(code int, msg string)

ExitWithMessage runs all registered exit handlers, prints the specified message and then exits the program with the specified exit code. If the exit code is 0, the message is prints to stdout, otherwise to stderr.

func RegisterExitHandler

func RegisterExitHandler(exitHandler func(code int) bool)

Register registers an exit handler function which is run when Exit is called

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL