diff --git a/test/diff.go b/test/diff.go index d7542bb6..477ae98f 100644 --- a/test/diff.go +++ b/test/diff.go @@ -5,15 +5,15 @@ import ( "github.com/pmezard/go-difflib/difflib" ) -func init() { - spew.Config.SortKeys = true // :\ -} - // Diff diffs two arbitrary data structures, giving human-readable output. func Diff(want, have interface{}) string { + config := spew.NewDefaultConfig() + config.ContinueOnMethod = true + config.SortKeys = true + config.SpewKeys = true text, _ := difflib.GetUnifiedDiffString(difflib.UnifiedDiff{ - A: difflib.SplitLines(spew.Sdump(want)), - B: difflib.SplitLines(spew.Sdump(have)), + A: difflib.SplitLines(config.Sdump(want)), + B: difflib.SplitLines(config.Sdump(have)), FromFile: "want", ToFile: "have", Context: 3,