Array values

This commit is contained in:
Thomas Pelletier
2021-02-08 20:38:53 -05:00
parent 0e8fd64203
commit 3488a91eff
2 changed files with 19 additions and 1 deletions
+9 -1
View File
@@ -141,7 +141,15 @@ func (u *unmarshaler) StringValue(v []byte) {
if u.err != nil {
return
}
u.top().SetString(string(v))
t := u.top()
if t.Type().Kind() == reflect.Slice {
s := reflect.ValueOf(string(v))
n := reflect.Append(t, s)
t.Set(n)
} else {
u.top().SetString(string(v))
}
}
func (u *unmarshaler) SimpleKey(v []byte) {