The textual diff approach is interesting - I'd thought of doing
something more data-aware, but that's nice and generic.
It won't necessarily tell you what field the difference is found in though.
We currently use a different approach, which doesn't
give such complete results, but is useful in many cases.
See
http://godoc.org/github.com/juju/testing/checkers#DeepEqual
It returns an error that describes where the deep-equal comparison fails
(it also compares a nil slice equal to an empty slice, which
is almost always what we want, because for testing purposes
we almost never want to distinguish the two)
The place it falls down is when you've got two long
slices that differ only in length. Perhaps a hybrid
approach could work well here - when there's a length
mismatch, resort to textual diff.
cheers,
rog.