Documentation
¶
Overview ¶
Package testleak centralises goroutine-leak detection for tests. It wraps goleak.VerifyTestMain with a shared ignore list for the long-lived goroutines gopherstack legitimately runs (metrics collectors, persistence timers, runtime/test-framework internals) so individual packages can opt in with a one-line TestMain:
func TestMain(m *testing.M) { testleak.VerifyTestMain(m) }
Packages that spawn their own known-persistent goroutines can pass extra goleak.Option values (e.g. goleak.IgnoreTopFunction("...")).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Baseline ¶
Baseline waits for a goroutine stack containing marker, then ignores every live goroutine. Not for parallel tests: it inspects the whole process.
func DefaultIgnores ¶
DefaultIgnores exposes the shared ignore list for callers that verify goroutines directly (e.g. goleak.VerifyNone) instead of via TestMain.
Types ¶
This section is empty.