This change also fixes another bug from v1.0.1 where fieldName.Text becomes nil after calling d.decodeTo(subv) because fieldName is a pointer and the value changes during reading other fields and structures. This bug has been fixed in in v1.1.0 but it might be safer to save the field name before calling decodeTo.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
If the
map
value is a pointer type (e.g.[]string
),Unmarshal
produces invalid data because it overrides the values from previous keys.For input
{headers:{key1:[val1],key2:[val2,val3],key3:[val4]}}
Unmarshal
producesinstead of
This change also fixes another bug from
v1.0.1
wherefieldName.Text
becomesnil
after callingd.decodeTo(subv)
becausefieldName
is a pointer and the value changes during reading other fields and structures. This bug has been fixed in inv1.1.0
but it might be safer to save the field name before callingdecodeTo
.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.