From f779d2e1a041ea63a6f017e24df480cee68e80e6 Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Wed, 4 Sep 2013 16:24:58 -0400 Subject: [PATCH] fixed unaddressable error --- struct.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/struct.go b/struct.go index 6694a53..8d8af66 100644 --- a/struct.go +++ b/struct.go @@ -181,9 +181,10 @@ func (b *structBuilder) Map() { if b == nil { return } + if v := b.val; v.Kind() == reflect.Ptr { if v.IsNil() { - v.Set(reflect.Zero(v.Type().Elem()).Addr()) + v.Set(reflect.New(v.Type().Elem())) b.Flush() } b.map_ = reflect.Value{}