aboutsummaryrefslogtreecommitdiff
path: root/cmp/options.go
diff options
context:
space:
mode:
authorJoe Tsai <joetsai@digital-static.net>2017-07-22 16:17:45 -0700
committerGitHub <noreply@github.com>2017-07-22 16:17:45 -0700
commita77394b709bf3eecbbd90fc51bd3d654af78f06b (patch)
tree5aececba34ada8ef7b1f1a9f60650f5b3bcaac5c /cmp/options.go
parent18107e6c56edb2d51f965f7d68e59404f0daee54 (diff)
downloadgo-cmp-a77394b709bf3eecbbd90fc51bd3d654af78f06b.tar.gz
Remove reporter TODO (#23)
The default reporter won't be adding context for equal values. Instead, we should work on the API for registering custom reporters.
Diffstat (limited to 'cmp/options.go')
-rw-r--r--cmp/options.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/cmp/options.go b/cmp/options.go
index 0d05c87..7b65baa 100644
--- a/cmp/options.go
+++ b/cmp/options.go
@@ -286,9 +286,14 @@ type visibleStructs map[reflect.Type]bool
func (visibleStructs) option() {}
// reporter is an Option that configures how differences are reported.
-//
-// TODO: Not exported yet, see concerns in defaultReporter.Report.
type reporter interface {
+ // TODO: Not exported yet.
+ //
+ // Perhaps add PushStep and PopStep and change Report to only accept
+ // a PathStep instead of the full-path? Adding a PushStep and PopStep makes
+ // it clear that we are traversing the value tree in a depth-first-search
+ // manner, which has an effect on how values are printed.
+
Option
// Report is called for every comparison made and will be provided with
@@ -297,8 +302,4 @@ type reporter interface {
// invalid reflect.Value if one of the values is non-existent;
// which is possible with maps and slices.
Report(x, y reflect.Value, eq bool, p Path)
-
- // TODO: Perhaps add PushStep and PopStep and change Report to only accept
- // a PathStep instead of the full-path? This change allows us to provide
- // better output closer to what pretty.Compare is able to achieve.
}