Description
assert.Equal could panic in some cases:
- values must be same type but not equal
- type must be struct with unexported field
- field must be map with array as keys
- map must have at least 2 values
Step To Reproduce
type test struct {
m map[[1]byte]*struct{}
}
a := test{
map[[1]byte]*struct{}{
{1}: nil,
{2}: nil,
},
}
b := test{}
assert.Equal(t, a, b)
https://go.dev/play/p/1tziFuRiCw4
Expected behavior
show diff
Actual behavior
--- FAIL: TestTest (0.00s)
panic: reflect.Value.Interface: cannot return value obtained from unexported field or method [recovered]
panic: reflect.Value.Interface: cannot return value obtained from unexported field or method
It fails on diff when trying to obtain dump from davecgh/go-spew, it's long time no updates nor fixes so probably worth to switch on something like yassinebenaid/godump