summaryrefslogtreecommitdiff
path: root/spew/format.go
diff options
context:
space:
mode:
authorDave Collins <[email protected]>2013-01-12 23:30:04 -0600
committerDave Collins <[email protected]>2013-01-12 23:30:04 -0600
commit389ea44d6a60b489ba166fe882b531e967dbc14a (patch)
treedf56b1c36f7370d138f1598fb78fa056e36fd14a /spew/format.go
parenta2ceabae67d4867f3edbffc1669e8267794ae860 (diff)
Fix incorrect type display on nil pointers.
This was reported by korschak as issue #4 who also pinpointed the issue and provided a patch.
Diffstat (limited to 'spew/format.go')
-rw-r--r--spew/format.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/spew/format.go b/spew/format.go
index 4a285e2..d55df63 100644
--- a/spew/format.go
+++ b/spew/format.go
@@ -115,11 +115,11 @@ func (f *formatState) formatPtr(v reflect.Value) {
indirects := 0
ve := v
for ve.Kind() == reflect.Ptr {
- indirects++
if ve.IsNil() {
nilFound = true
break
}
+ indirects++
addr := ve.Pointer()
pointerChain = append(pointerChain, addr)
if pd, ok := f.pointers[addr]; ok && pd < f.depth {