Documentation
¶
Overview ¶
Package goleaktest provides a small helper for wiring go.uber.org/goleak into a package's TestMain so goroutine leaks fail the test suite.
Usage in a package's <pkg>_test.go:
func TestMain(m *testing.M) {
goleaktest.TestMain(m)
}
Tests that intentionally leave a goroutine running should clean it up. If that is impossible, register an ignore via goleak.IgnoreAnyFunction(...) and pass it through Options.Extra.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct {
// IgnoreCurrent ignores all goroutines that are running at the time of the call.
IgnoreCurrent bool
// Extra appends additional goleak.Option values.
Extra []goleak.Option
}
Options holds goleak options for packages that need to ignore known, long-lived goroutines.
Click to show internal directories.
Click to hide internal directories.