Closed andrewmostello closed 4 years ago
Makes sense. Originally, I was thinking an error is its Error() string
interface output, but that's not really true. There are "rich" errors like the ones you have in the test case, and these extra fields matter. Thanks for the thorough test case!
In the existing implementation, if a type implements Error, but has other values that differ, deep.Equal returns without reporting a diff. This is because it is only checking the value of the Error strings.
If a type implements Error, the Error strings should be evaluated, but then deep.Equal should continue to look for a diff. To cover this case, continue testing a and b after passing the Error check.