Involved Source Files Package exit provides stubs so that unit tests can exercise code that calls
os.Exit(1).
Package-Level Type Names (only one, which is exported)
/* sort exporteds by: | */
A StubbedExit is a testing fake for os.Exit.CodeintExitedboolprevfunc(code int) Unstub restores the previous exit function.(*StubbedExit) exit(code int)
func Stub() *StubbedExit
func WithStub(f func()) *StubbedExit
Package-Level Functions (total 3, all are exported)
Stub substitutes a fake for the call to os.Exit(1).
With terminates the process by calling os.Exit(code). If the package is
stubbed, it instead records a call in the testing spy.
WithStub runs the supplied function with Exit stubbed. It returns the stub
used, so that users can test whether the process would have crashed.
Package-Level Variables (only one, which is unexported)
The pages are generated with Goldsv0.6.7. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds.