Skip to content

AlexanderYastrebov/noleak

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple goroutine leak detector

It compares the list of active goroutines before and after the test and reports an error on mismatch.

To enable detector add a main_test.go file to the package.

To check a specific test only add noleak.Check(t) at the top.

Tests using http.Client or http.DefaultClient should close idle connections.

See and run all examples:

GODEBUG=tracebackancestors=10 go test ./examples/...

Setting GODEBUG=tracebackancestors=N extends tracebacks with the stacks at which goroutines were created, where N limits the number of ancestor goroutines to report, see https://pkg.go.dev/runtime#hdr-Environment_Variables.

Credits

About

Simple goroutine leak detector

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages