Registry / testing / goleak

goleak

JSON →
library1.3.0gogounverified

Goroutine leak detector for Go tests, ensuring no goroutines are leaked after test completion.

go get go.uber.org/goleak
INSTALL
IMPORT
SIG · GOLEAK
G
goleak
testinggov1.3.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

goleak
go.uber.org/goleak

Verify no goroutines are leaked in a test function.

package main import ( "testing" "go.uber.org/goleak" ) func TestSomething(t *testing.T) { defer goleak.VerifyNone(t) // test code that should not leak goroutines }
Debug
Known issues
gotchagoleak may report false positives if goroutines are started by background processes (e.g., GC, profiling).
fix
Use goleak.IgnoreCurrent() to exclude goroutines already running before the test.
affects: >=1.0.0
Upgrade
Version history
1.3.0latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources
goleak — go get goleak · libregistry