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)
/* sort by: | */
A StubbedExit is a testing fake for os.Exit.CodeintExitedbool Unstub restores the previous exit function.
func Stub() *StubbedExit
func WithStub(f func()) *StubbedExit
Package-Level Functions (total 3)
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.
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.