From 5a6d4b96218187544a0b8f82b5c7c19c333233e2 Mon Sep 17 00:00:00 2001 From: anatoly Date: Fri, 3 Nov 2017 10:01:26 -0400 Subject: [PATCH] unmarshal: return Go zero value type for EDN nil discussion: https://github.com/go-edn/edn/issues/11 --- decode.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/decode.go b/decode.go index a3bfded..48d9c87 100644 --- a/decode.go +++ b/decode.go @@ -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'