Commit 3cc2da63 authored by Alberto Donizetti's avatar Alberto Donizetti Committed by Brad Fitzpatrick

encoding/json: clarify unmarshaling behaviour on bad fields

Fixes #19526

Change-Id: Ifaaf454e0e89fdf4309118c2e2e6ac0d0a43c39d
Reviewed-on: https://go-review.googlesource.com/44711Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent a4ee95c8
...@@ -79,7 +79,9 @@ import ( ...@@ -79,7 +79,9 @@ import (
// or if a JSON number overflows the target type, Unmarshal // or if a JSON number overflows the target type, Unmarshal
// skips that field and completes the unmarshaling as best it can. // skips that field and completes the unmarshaling as best it can.
// If no more serious errors are encountered, Unmarshal returns // 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 // 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 // by setting that Go value to nil. Because null is often used in JSON to mean
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment