mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
encoding/json: recover saved error context when unmarshalling
Fixes: #27464 Change-Id: I270c56fd0d5ae8787a1293029aff3072f4f52f33 Reviewed-on: https://go-review.googlesource.com/132955 Reviewed-by: Daniel Martí <mvdan@mvdan.cc> Run-TryBot: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
6b7099caa1
commit
22afb3571c
2 changed files with 12 additions and 1 deletions
|
|
@ -179,7 +179,7 @@ func (d *decodeState) unmarshal(v interface{}) error {
|
|||
// test must be applied at the top level of the value.
|
||||
err := d.value(rv)
|
||||
if err != nil {
|
||||
return err
|
||||
return d.addErrorContext(err)
|
||||
}
|
||||
return d.savedError
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue