testify icon indicating copy to clipboard operation
testify copied to clipboard

Update didPanic to work with Go 1.21+

Open bwplotka opened this issue 2 years ago • 1 comments

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

bwplotka avatar Mar 02 '23 12:03 bwplotka

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.

dolmen avatar Jul 04 '23 08:07 dolmen