From a77394b709bf3eecbbd90fc51bd3d654af78f06b Mon Sep 17 00:00:00 2001 From: Joe Tsai Date: Sat, 22 Jul 2017 16:17:45 -0700 Subject: 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. --- cmp/options.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'cmp/options.go') 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. } -- cgit v1.2.3