Use Cleanup to remove old entries in ts map
This commit is contained in:
parent
fe8a28286e
commit
d20ac9444a
@ -24,6 +24,10 @@ func New(t T) Assert {
|
|||||||
f := runtime.FuncForPC(reflect.ValueOf(a).Pointer())
|
f := runtime.FuncForPC(reflect.ValueOf(a).Pointer())
|
||||||
ts[f] = t
|
ts[f] = t
|
||||||
|
|
||||||
|
t.Cleanup(func() {
|
||||||
|
delete(ts, f)
|
||||||
|
})
|
||||||
|
|
||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user