go-test / deep

Golang deep variable equality test that returns human-readable differences
MIT License
743 stars 54 forks source link

panic on typed primitives that implement error interface #31

Closed Melaninneal closed 4 years ago

Melaninneal commented 4 years ago

doing a deep equal on errors often panics on reflect calls

&url.Error{ Op: "parse", URL: "http:// invalid.url.com/path?unencoded=true", Err: url.InvalidHostError(" "), }

daniel-nichter commented 4 years ago

Thanks for the bug report. I'll try to create a test case with that example.

daniel-nichter commented 4 years ago

Real issue is https://golang.org/pkg/net/url/#InvalidHostError It's a string that implements the error interface.

daniel-nichter commented 4 years ago

Fixed in master. Will be released in v1.0.3.