MCPcopy
hub / github.com/uber-go/zap / Stub

Function Stub

internal/exit/exit.go:43–47  ·  view source on GitHub ↗

Stub substitutes a fake for the call to os.Exit(1).

()

Source from the content-addressed store, hash-verified

41
42// Stub substitutes a fake for the call to os.Exit(1).
43func Stub() *StubbedExit {
44 s := &StubbedExit{prev: _exit}
45 _exit = s.exit
46 return s
47}
48
49// WithStub runs the supplied function with Exit stubbed. It returns the stub
50// used, so that users can test whether the process would have crashed.

Callers 2

TestLoggerFatalOnNoopFunction · 0.92
WithStubFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestLoggerFatalOnNoopFunction · 0.74