]> Cypherpunks repositories - gostls13.git/commitdiff
encoding/json: document that object keys are sorted
authorScott Bell <scott@sctsm.com>
Mon, 16 May 2016 19:36:02 +0000 (12:36 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 16 May 2016 19:43:53 +0000 (19:43 +0000)
Fixes #15424

Change-Id: Ib9e97509f5ac239ee54fe6fe37152a7f5fc75087
Reviewed-on: https://go-review.googlesource.com/23109
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/encoding/json/encode.go

index 8b967471ce70fcf120d85c1dc738b48e41e67313..f91a78724cf44dc2afb09c0b82a36fa09a64b805 100644 (file)
@@ -119,8 +119,8 @@ import (
 //
 // Map values encode as JSON objects. The map's key type must either be a
 // string, an integer type, or implement encoding.TextMarshaler. The map keys
-// are used as JSON object keys by applying the following rules, subject to the
-// UTF-8 coercion described for string values above:
+// are sorted and used as JSON object keys by applying the following rules,
+// subject to the UTF-8 coercion described for string values above:
 //   - string keys are used directly
 //   - encoding.TextMarshalers are marshaled
 //   - integer keys are converted to strings