summaryrefslogtreecommitdiff
path: root/spew/common.go
diff options
context:
space:
mode:
authorDave Collins <[email protected]>2013-01-10 20:31:03 -0600
committerDave Collins <[email protected]>2013-01-10 20:39:05 -0600
commit184d118062e467401f87c22ea4034135cf508529 (patch)
tree9ebc419e52747bff3f6901b15ce3793a30258cbc /spew/common.go
parent04998fcda361bb6a087d58560bfa03ec3038529f (diff)
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.
Diffstat (limited to 'spew/common.go')
-rw-r--r--spew/common.go4
1 files changed, 2 insertions, 2 deletions
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)
}