summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2013-01-31 07:49:23 -0800
committerRuss Cox <rsc@golang.org>2013-01-31 07:49:23 -0800
commitf3849bfcf7e95602541cf12f3e38e68ad8f4565d (patch)
tree7ff27c6b46ccdee85beffca75322ef07757bf232 /src
parent86e7f045a7cf645706eccaf5b9826195cbcf343b (diff)
downloadgo-f3849bfcf7e95602541cf12f3e38e68ad8f4565d.tar.gz
encoding/json: document case-insensitive Unmarshal key matching
Fixes issue 4664. R=golang-dev, adg CC=golang-dev https://codereview.appspot.com/7237060
Diffstat (limited to 'src')
-rw-r--r--src/pkg/encoding/json/decode.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/pkg/encoding/json/decode.go b/src/pkg/encoding/json/decode.go
index 610945022..1d723af12 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,