diff options
author | Joe Tsai <joetsai@digital-static.net> | 2017-07-22 16:17:45 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-22 16:17:45 -0700 |
commit | a77394b709bf3eecbbd90fc51bd3d654af78f06b (patch) | |
tree | 5aececba34ada8ef7b1f1a9f60650f5b3bcaac5c /cmp | |
parent | 18107e6c56edb2d51f965f7d68e59404f0daee54 (diff) | |
download | go-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')
-rw-r--r-- | cmp/options.go | 13 | ||||
-rw-r--r-- | cmp/reporter.go | 1 |
2 files changed, 7 insertions, 7 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. } diff --git a/cmp/reporter.go b/cmp/reporter.go index faebc05..a21d0cd 100644 --- a/cmp/reporter.go +++ b/cmp/reporter.go @@ -24,7 +24,6 @@ var _ reporter = (*defaultReporter)(nil) func (r *defaultReporter) Report(x, y reflect.Value, eq bool, p Path) { if eq { - // TODO: Maybe print some equal results for context? return // Ignore equal results } const maxBytes = 4096 |