summaryrefslogtreecommitdiff
path: root/spew/format.go
diff options
context:
space:
mode:
Diffstat (limited to 'spew/format.go')
-rw-r--r--spew/format.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/spew/format.go b/spew/format.go
index b6b1fb0..cc152ae 100644
--- a/spew/format.go
+++ b/spew/format.go
@@ -296,6 +296,12 @@ func (f *formatState) format(v reflect.Value) {
// been handled above.
case reflect.Map:
+ // nil maps should be indicated as different than empty maps
+ if v.IsNil() {
+ f.fs.Write(nilAngleBytes)
+ break
+ }
+
f.fs.Write(openMapBytes)
f.depth++
if (f.cs.MaxDepth != 0) && (f.depth > f.cs.MaxDepth) {