Skip to content

Commit da4c3ff

Browse files
authored
Default diff-printer to hide details (#103)
This new setting will make it print the difference between String() output only. This is more usable for developers in 99% of cases where the difference can be seen.
1 parent 54b7e30 commit da4c3ff

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/diff.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ import (
88
// Diff diffs two arbitrary data structures, giving human-readable output.
99
func Diff(want, have interface{}) string {
1010
config := spew.NewDefaultConfig()
11-
config.ContinueOnMethod = true
11+
// Set ContinueOnMethod to true if you cannot see a difference and
12+
// want to look beyond the String() method
13+
config.ContinueOnMethod = false
1214
config.SortKeys = true
1315
config.SpewKeys = true
1416
text, _ := difflib.GetUnifiedDiffString(difflib.UnifiedDiff{

0 commit comments

Comments
 (0)