exit

package
v0.0.0-...-8318cca Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2019 License: MIT Imports: 1 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exit

type Exit struct {
	// contains filtered or unexported fields
}

Exit has an exit func, and will memorize the exit status code

func Default

func Default() *Exit

Default returns an Exit with default os.Exit() call. That means the status will never be visible, since os.Exit() stops everything.

func New

func New(exit Func) *Exit

NewExiter returns an exiter with a custom function

func (*Exit) Exit

func (e *Exit) Exit(code int)

Exit calls the exiter, and then returns code as status. If e was declared, but never set (since only a test would set e), simply calls os.Exit()

func (*Exit) Status

func (e *Exit) Status() int

Status get the exit status code as memorized after the call to the exit func.

type Func

type Func func(int)

Func takes a code as exit status

Jump to

Keyboard shortcuts

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