Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Check ¶
Check reports test error if there are active goroutines after test ends.
Example:
func TestLeak(t *testing.T) {
noleak.Check(t)
...
}
func CheckMain ¶
CheckMain prints active goroutines after all tests end. It returns result of m.Run() or non-zero if there are active goroutines.
Example:
func TestMain(m *testing.M) {
os.Exit(noleak.CheckMain(m))
}
func CheckMainFunc ¶
CheckMainFunc prints active goroutines after m ends. It returns result of m or non-zero if there are active goroutines.
Example:
func TestMain(m *testing.M) {
os.Exit(noleak.CheckMainFunc(func() int {
code := m.Run()
// perform cleanup
...
return code
}))
}
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.