gorocheck

package module
v0.0.0-...-751c3c6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2017 License: MIT Imports: 6 Imported by: 0

README

gorocheck

A goroutine leak checker library

Usage

Using gorocheck is simple, just import it, and run CheckForLeaks() at the end of your test!

Example:

func TestManyThings(t *testing.T) {
	td := NewThingDoer()
	td.DoThingsAsync()
	err := td.WaitForThingsToBeDone()

	// ensure things were done properly
	if err != nil {
		t.Fatal(err)
	}

	// pass nil for no goroutine filter
	err = gorocheck.CheckForLeaks(nil)
	if err != nil {
		t.Fatal(err)
	}
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckForLeaks

func CheckForLeaks(filter func(*Goroutine) bool) error

Types

type Goroutine

type Goroutine struct {
	Function string
	Number   int
	Action   string
	Stack    []string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL