diff --git a/assert.go b/assert.go index 1a3166b..bf26a02 100644 --- a/assert.go +++ b/assert.go @@ -24,6 +24,10 @@ func New(t T) Assert { f := runtime.FuncForPC(reflect.ValueOf(a).Pointer()) ts[f] = t + t.Cleanup(func() { + delete(ts, f) + }) + return a } diff --git a/type.go b/type.go index 1c9a1fd..2a4b72a 100644 --- a/type.go +++ b/type.go @@ -4,4 +4,5 @@ package assert type T interface { Error(...interface{}) Helper() + Cleanup(func()) }