From 04cdfd42973bb9c8589fd6a731800cf222fde1a9 Mon Sep 17 00:00:00 2001 From: Alexander Staubo Date: Fri, 28 Oct 2016 13:58:48 -0400 Subject: Adds new config options: DisablePointerAddresses: Specifies whether to disable the printing of pointer addresses. DisableCapacities specifies whether to disable the printing of capacities for arrays, slices, maps and channels. These are useful when diffing data structures in tests. Printing pointers and capacities would otherwise lead to false negatives. --- spew/config.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'spew/config.go') diff --git a/spew/config.go b/spew/config.go index 5552827..9db83c6 100644 --- a/spew/config.go +++ b/spew/config.go @@ -67,6 +67,15 @@ type ConfigState struct { // Google App Engine or with the "safe" build tag specified. DisablePointerMethods bool + // DisablePointerAddresses specifies whether to disable the printing of + // pointer addresses. This is useful when diffing data structures in tests. + DisablePointerAddresses bool + + // DisableCapacities specifies whether to disable the printing of capacities + // for arrays, slices, maps and channels. This is useful when diffing + // data structures in tests. + DisableCapacities bool + // ContinueOnMethod specifies whether or not recursion should continue once // a custom error or Stringer interface is invoked. The default, false, // means it will print the results of invoking the custom error or Stringer -- cgit v1.2.3