aboutsummaryrefslogtreecommitdiff
path: root/src/encoding
diff options
context:
space:
mode:
authorAlberto Donizetti <alb.donizetti@gmail.com>2017-06-03 21:36:51 +0200
committerBrad Fitzpatrick <bradfitz@golang.org>2017-06-05 16:32:35 +0000
commit3cc2da6397e5ca8efd5d0cf3e919f33bc74dc4b6 (patch)
tree4e7c42c4e18169f39fe0730738652927a55e8c33 /src/encoding
parenta4ee95c805fb77e594603bcd62d7858dc9e853ab (diff)
downloadgo-3cc2da6397e5ca8efd5d0cf3e919f33bc74dc4b6.tar.xz
encoding/json: clarify unmarshaling behaviour on bad fields
Fixes #19526 Change-Id: Ifaaf454e0e89fdf4309118c2e2e6ac0d0a43c39d Reviewed-on: https://go-review.googlesource.com/44711 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/encoding')
-rw-r--r--src/encoding/json/decode.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/encoding/json/decode.go b/src/encoding/json/decode.go
index 41d0aefbeb..710c835547 100644
--- a/src/encoding/json/decode.go
+++ b/src/encoding/json/decode.go
@@ -79,7 +79,9 @@ import (
// or if a JSON number overflows the target type, Unmarshal
// skips that field and completes the unmarshaling as best it can.
// If no more serious errors are encountered, Unmarshal returns
-// an UnmarshalTypeError describing the earliest such error.
+// an UnmarshalTypeError describing the earliest such error. In any
+// case, it's not guaranteed that all the remaining fields following
+// the problematic one will be unmarshaled into the target object.
//
// The JSON null value unmarshals into an interface, map, pointer, or slice
// by setting that Go value to nil. Because null is often used in JSON to mean