testify
testify copied to clipboard
Update didPanic to work with Go 1.21+
I know it's not released yet, but new Go version will have new behaviour on panic(nil). Fixing to make it work, if you don't want to merge until current tip is released, feel free to close.
See behaviour by changing "dev" to "1.20": https://go.dev/play/p/Cevh9AJdhC6?v=gotip
The code should be more strict and instead check if errors.As(err, new(runtime.PanicNilError)). However that will require go1.21, so this check must be wrapped in a function func isPanicNilError(error) bool that must be declared in a separate Go source with a //go:build go1.21 tag.