Skip to content
Browse files

Document goleak usage

- Expand the Contribution guide so to describe using `goleak` in unit
tests.  This package provides a simple method for detecting goroutine
leaks in tests. This will help ensure that we write safe code.

Signed-off-by: Lucas Roesler <>
  • Loading branch information...
LucasRoesler authored and alexellis committed Jul 6, 2019
1 parent 2b37a01 commit a259d1256cca43c78d965a2067750a266b2256a2
Showing with 8 additions and 0 deletions.
  1. +8 −0
@@ -117,6 +117,14 @@ If you would like to ammend your commit follow this guide: [Git: Rewriting Histo

Please follow style guide on [this blog post]( from [The Go Programming Language](

If you are making changes to code that use goroutines, consider adding `goleak` to your test to help ensure that we are not leaking any goroutines. Simply add

defer goleak.VerifyNoLeaks(t)

at the very beginning of the test, and it will fail the test if it detects goroutines that were opened but never cleaned up at the end of the test.

#### I have a question, a suggestion or need help

If you have a simple question you can [join the Slack community]( and ask there, but please bear in mind that contributors may live in a different timezone or be working to a different timeline to you. If you have an urgent request then let them know about this.

0 comments on commit a259d12

Please sign in to comment.
You can’t perform that action at this time.