From: Russ Cox Date: Thu, 31 Jan 2013 15:49:23 +0000 (-0800) Subject: encoding/json: document case-insensitive Unmarshal key matching X-Git-Tag: go1.1rc2~1219 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=956cd0059c49870161a31ed7403199e3f0e19ad2;p=gostls13.git encoding/json: document case-insensitive Unmarshal key matching Fixes #4664. R=golang-dev, adg CC=golang-dev https://golang.org/cl/7237060 --- diff --git a/src/pkg/encoding/json/decode.go b/src/pkg/encoding/json/decode.go index 6109450221..1d723af12b 100644 --- a/src/pkg/encoding/json/decode.go +++ b/src/pkg/encoding/json/decode.go @@ -33,6 +33,10 @@ import ( // the value pointed at by the pointer. If the pointer is nil, Unmarshal // allocates a new value for it to point to. // +// To unmarshal JSON into a struct, Unmarshal matches incoming object +// keys to the keys used by Marshal (either the struct field name or its tag), +// preferring an exact match but also accepting a case-insensitive match. +// // To unmarshal JSON into an interface value, Unmarshal unmarshals // the JSON into the concrete value contained in the interface value. // If the interface value is nil, that is, has no concrete value stored in it,