maintner: compare errors via their public API
maintner: compare errors via their public API

The internal representation of the type implementing the error
interface returned by fmt.Errorf may change in new versions of Go,
and reflect.DeepEqual is not suitable for making stable comparisons.

For more complicated comparisons the go-cmp package should be used,
but since we're just comparing two error values, use a simple helper
instead.

Remove insignificant trailing whitespace from Go strings containing
JSON objects.

Fixes golang/go#30442

Change-Id: Iecfb89ebcaf97b49fbe34b4fb17daa7fe70d6a7e
Reviewed-on: https://go-review.googlesource.com/c/164297
Run-TryBot: Dmitri Shuralyov <d181b7fea0ec87c86ba5a890ab716db52498e3ba@golang.org>
TryBot-Result: Gobot Gobot <66cb808b70d30c07676d5e946fee83fd561249e5@golang.org>
Reviewed-by: Brad Fitzpatrick <ae9783c0b0efc69cd85ab025ddd17aa44cdc4aa5@golang.org>

golang/build,golang/build,golang/build,golang/build