mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
json: fix array -> non-array decoding
Fixes #773. R=adg CC=golang-dev https://golang.org/cl/1120042
This commit is contained in:
parent
916426ea76
commit
4e5bc6a8fe
2 changed files with 30 additions and 19 deletions
|
|
@ -304,6 +304,9 @@ func (d *decodeState) array(v reflect.Value) {
|
|||
av, ok := v.(reflect.ArrayOrSliceValue)
|
||||
if !ok {
|
||||
d.saveError(&UnmarshalTypeError{"array", v.Type()})
|
||||
d.off--
|
||||
d.next()
|
||||
return
|
||||
}
|
||||
|
||||
sv, _ := v.(*reflect.SliceValue)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue