Skip to content

Commit

Permalink
unmarshal: return Go zero value type for EDN nil
Browse files Browse the repository at this point in the history
discussion: go-edn#11
  • Loading branch information
tolitius committed Nov 3, 2017
1 parent d191449 commit 5a6d4b9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,8 @@ func (d *Decoder) literal(bs []byte, ttype tokenType, v reflect.Value) {
case reflect.Interface, reflect.Ptr, reflect.Map, reflect.Slice:
v.Set(reflect.Zero(v.Type()))
default:
d.error(&UnmarshalTypeError{"nil", v.Type()})
v.Set(reflect.Zero(v.Type()))
// d.error(&UnmarshalTypeError{"nil", v.Type()})
}
} else if bytes.Equal(trueByte, bs) || bytes.Equal(falseByte, bs) { // true|false
value := bs[0] == 't'
Expand Down

0 comments on commit 5a6d4b9

Please sign in to comment.