fixed unaddressable error

This commit is contained in:
Emery Hemingway 2013-09-04 16:24:58 -04:00
parent f6e5343dbf
commit f779d2e1a0
1 changed files with 2 additions and 1 deletions

View File

@ -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{}