From 389ea44d6a60b489ba166fe882b531e967dbc14a Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Sat, 12 Jan 2013 23:30:04 -0600 Subject: Fix incorrect type display on nil pointers. This was reported by korschak as issue #4 who also pinpointed the issue and provided a patch. --- spew/format.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'spew/format.go') 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 { -- cgit v1.2.3