chore_: use t.Cleanup

This commit is contained in:
frank 2024-09-19 16:46:00 +08:00
parent fcc995f157
commit 4eb420d179
No known key found for this signature in database
GPG Key ID: B56FA1FC264D28FD
1 changed files with 2 additions and 2 deletions

View File

@ -12,9 +12,9 @@ func TestGo(t *testing.T) {
paniced := false
panicErr := "test panic"
oldDefaultPanicFunc := defaultPanicFunc
defer func() {
t.Cleanup(func() {
defaultPanicFunc = oldDefaultPanicFunc
}()
})
defaultPanicFunc = func(err any) {
require.NotNil(t, err)
paniced = true