aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Jacobs <jacobsa@google.com>2015-02-19 09:35:28 +1100
committerAndrew Gerrand <adg@golang.org>2015-02-18 23:57:36 +0000
commit9df81f822128b4057f6713bff1421b8ee3fec555 (patch)
treed7d70bda8c1d45d58ea41797bdd6145604e052f9
parent84c7a6583aac493fec25e87c60be7b98508c5b43 (diff)
downloadgo-9df81f822128b4057f6713bff1421b8ee3fec555.tar.gz
go-9df81f822128b4057f6713bff1421b8ee3fec555.zip
encoding/json: Fixed the comment specifying Marshal behavior for maps.
The comment previously was reversed in sense (it appeared to be describing unmarshaling). I've fixed that, and added the caveat that map keys are subject to UTF-8 coercion like other strings. Change-Id: Id08082aa71401a6e7530a42f979fbb50bd1f4e6a Reviewed-on: https://go-review.googlesource.com/5221 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Andrew Gerrand <adg@golang.org>
-rw-r--r--src/encoding/json/encode.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/encoding/json/encode.go b/src/encoding/json/encode.go
index e59a0b3bbf..4db9f35e69 100644
--- a/src/encoding/json/encode.go
+++ b/src/encoding/json/encode.go
@@ -113,8 +113,8 @@ import (
// a JSON tag of "-".
//
// Map values encode as JSON objects.
-// The map's key type must be string; the object keys are used directly
-// as map keys.
+// The map's key type must be string; the map keys are used as JSON object
+// keys, subject to the UTF-8 coercion described for string values above.
//
// Pointer values encode as the value pointed to.
// A nil pointer encodes as the null JSON object.