diff --git a/leaks.go b/leaks.go index 468dbaf..3474b02 100644 --- a/leaks.go +++ b/leaks.go @@ -29,6 +29,7 @@ import ( // TestingT is the minimal subset of testing.TB that we use. type TestingT interface { Error(...interface{}) + Helper() } // filterStacks will filter any stacks excluded by the given opts. @@ -74,6 +75,7 @@ func Find(options ...Option) error { // tests by doing: // defer VerifyNone(t) func VerifyNone(t TestingT, options ...Option) { + t.Helper() if err := Find(options...); err != nil { t.Error(err) } diff --git a/leaks_test.go b/leaks_test.go index f80a4ea..b6d408c 100644 --- a/leaks_test.go +++ b/leaks_test.go @@ -73,6 +73,8 @@ func (ft *fakeT) Error(args ...interface{}) { ft.errors = append(ft.errors, fmt.Sprint(args...)) } +func (*fakeT) Helper() {} + func TestVerifyNone(t *testing.T) { ft := &fakeT{} VerifyNone(ft)