diff options
| author | Dave Collins <[email protected]> | 2013-03-27 22:42:24 -0500 |
|---|---|---|
| committer | Dave Collins <[email protected]> | 2013-03-27 22:50:09 -0500 |
| commit | 173295b96ea124eed74b2d172c109a1fc8043b37 (patch) | |
| tree | 1a576f8330217037941fd35f82df33e9418f4606 /spew/dump.go | |
| parent | ff59042e2ea29bc131735627a004d9db2e410742 (diff) | |
Fix incorrect val display on packed nil interfaces.
This was reported by shurcooL as issue #12.
Diffstat (limited to 'spew/dump.go')
| -rw-r--r-- | spew/dump.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/spew/dump.go b/spew/dump.go index 98a68f1..8dd8ca9 100644 --- a/spew/dump.go +++ b/spew/dump.go @@ -262,7 +262,11 @@ func (d *dumpState) dump(v reflect.Value) { d.w.Write([]byte(strconv.Quote(v.String()))) case reflect.Interface: - // Do nothing. We should never get here due to unpackValue calls. + // The only time we should get here is for nil interfaces due to + // unpackValue calls. + if v.IsNil() { + d.w.Write(nilAngleBytes) + } case reflect.Ptr: // Do nothing. We should never get here since pointers have already |
