Skip to content

Commit 1810008

Browse files
Scott Bellbradfitz
Scott Bell
authored andcommitted
encoding/json: document that object keys are sorted
Fixes #15424 Change-Id: Ib9e97509f5ac239ee54fe6fe37152a7f5fc75087 Reviewed-on: https://go-review.googlesource.com/23109 Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent 64770f6 commit 1810008

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/encoding/json/encode.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ import (
119119
//
120120
// Map values encode as JSON objects. The map's key type must either be a
121121
// string, an integer type, or implement encoding.TextMarshaler. The map keys
122-
// are used as JSON object keys by applying the following rules, subject to the
123-
// UTF-8 coercion described for string values above:
122+
// are sorted and used as JSON object keys by applying the following rules,
123+
// subject to the UTF-8 coercion described for string values above:
124124
// - string keys are used directly
125125
// - encoding.TextMarshalers are marshaled
126126
// - integer keys are converted to strings

0 commit comments

Comments
 (0)