From 184d118062e467401f87c22ea4034135cf508529 Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Thu, 10 Jan 2013 20:31:03 -0600 Subject: Add config pointers to format and dump states. This paves the way to support individual configuration options through a separate type while still providing the simple global config and package level methods. --- spew/common.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'spew/common.go') diff --git a/spew/common.go b/spew/common.go index 69b95e4..d389ccb 100644 --- a/spew/common.go +++ b/spew/common.go @@ -125,7 +125,7 @@ func catchPanic(w io.Writer, v reflect.Value) { // // It handles panics in any called methods by catching and displaying the error // as the formatted value. -func handleMethods(w io.Writer, v reflect.Value) (handled bool) { +func handleMethods(cs *ConfigState, w io.Writer, v reflect.Value) (handled bool) { // We need an interface to check if the type implements the error or // Stringer interface. However, the reflect package won't give us an // an interface on certain things like unexported struct fields in order @@ -142,7 +142,7 @@ func handleMethods(w io.Writer, v reflect.Value) (handled bool) { // Stringer interface with a pointer receiver should not be mutating their // state inside these interface methods. var viface interface{} - if !Config.DisablePointerMethods { + if !cs.DisablePointerMethods { if !v.CanAddr() { v = unsafeReflectValue(v) } -- cgit v1.2.3