]> Cypherpunks repositories - gostls13.git/commitdiff
encoding/json: Fixed the comment specifying Marshal behavior for maps.
authorAaron Jacobs <jacobsa@google.com>
Wed, 18 Feb 2015 22:35:28 +0000 (09:35 +1100)
committerAndrew Gerrand <adg@golang.org>
Wed, 18 Feb 2015 23:57:36 +0000 (23:57 +0000)
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>
src/encoding/json/encode.go

index e59a0b3bbfd0a9d49d607fee91bd15739ad9b59d..4db9f35e6918964d1bcb478b0c5418a868c560fd 100644 (file)
@@ -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.