aboutsummaryrefslogtreecommitdiff
path: root/src/encoding/json/decode.go
diff options
context:
space:
mode:
authorIan Davis <nospam@iandavis.com>2018-09-03 11:20:23 +0100
committerDaniel Martí <mvdan@mvdan.cc>2018-09-06 08:38:44 +0000
commit22afb3571c4bb6268664ecc5da4416ec58d3e060 (patch)
tree7ca7bf7cc853c1b2ae0baff53b043113827019e5 /src/encoding/json/decode.go
parent6b7099caa17e50410821f4a66ebb5c48717ad3c7 (diff)
downloadgo-22afb3571c4bb6268664ecc5da4416ec58d3e060.tar.xz
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>
Diffstat (limited to 'src/encoding/json/decode.go')
-rw-r--r--src/encoding/json/decode.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/encoding/json/decode.go b/src/encoding/json/decode.go
index fd2bf92dc2..82dc78083a 100644
--- a/src/encoding/json/decode.go
+++ b/src/encoding/json/decode.go
@@ -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
}