Closed gmarik closed 6 years ago
Thanks for the test cases and fix! Sorry it's taken about 4 months to review and merge (super busy at work and such).
The failing test is a false-positive because it looks like go1.8 differs in how it prints some stuff compared to 1.7 and 1.6. I'll fix that later.
I'll merge because it's a good fix, but re note 1: I'll need to revert the change in output because printing the full value of a struct will be more noise than signal, imho, especially if the struct has many fields. Also, I'd argue that the values don't matter at this point because the diff is saying one var is nil
, so whatever the values of the non-nil struct aren't a consideration yet because we can't compare values.
Problem
deep.Equal
panics onmap[string]interface{}
diff having different value types. SeeTestInterface2
deep.Equal
skips pointer diff. SeeTestInterface3
Solution
c.equal(v1, v2)
c.equal(v1, v2)
Notes
deep.Equal
reports differences by printing actual values: see4cc30ce
how it changes expectations4cc30ce
is a "quick fix" to make things work, so please let me know how it could be improved…