From: Ian Lance Taylor Date: Fri, 8 Jan 2016 02:48:42 +0000 (-0800) Subject: encoding/json: doc: Decode only writes to exported fields X-Git-Tag: go1.6beta2~70 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=5755c011de9c75a05825b0c08ce61c77c5207f1d;p=gostls13.git encoding/json: doc: Decode only writes to exported fields Fixes #13867. Change-Id: I6c0a6c64369681840df60f63036c2eece27de8b8 Reviewed-on: https://go-review.googlesource.com/18394 Reviewed-by: Russ Cox --- diff --git a/src/encoding/json/decode.go b/src/encoding/json/decode.go index 099d7f6da5..539d952ad6 100644 --- a/src/encoding/json/decode.go +++ b/src/encoding/json/decode.go @@ -37,6 +37,7 @@ import ( // 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. +// Unmarshal will only set exported fields of the struct. // // To unmarshal JSON into an interface value, // Unmarshal stores one of these in the interface value: