]> Cypherpunks repositories - gostls13.git/commitdiff
encoding/json: clarify unmarshaling behaviour on bad fields
authorAlberto Donizetti <alb.donizetti@gmail.com>
Sat, 3 Jun 2017 19:36:51 +0000 (21:36 +0200)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 5 Jun 2017 16:32:35 +0000 (16:32 +0000)
Fixes #19526

Change-Id: Ifaaf454e0e89fdf4309118c2e2e6ac0d0a43c39d
Reviewed-on: https://go-review.googlesource.com/44711
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/encoding/json/decode.go

index 41d0aefbeb848c202d91f7e036ff94d97e56ce29..710c835547e7a2f6388c88a4489f0288db2c46af 100644 (file)
@@ -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