]> Cypherpunks repositories - gostls13.git/commitdiff
encoding/json: clarify Marshal behavior for string keys of maps
authorEli Bendersky <eliben@google.com>
Wed, 31 Jul 2019 20:42:16 +0000 (13:42 -0700)
committerIan Lance Taylor <iant@golang.org>
Wed, 31 Jul 2019 21:49:08 +0000 (21:49 +0000)
This is a documentation-only change.

Fixes #28827

Change-Id: Ife9ab997809048784f35872b09905bc209a05eff
Reviewed-on: https://go-review.googlesource.com/c/go/+/188417
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/encoding/json/encode.go

index 3474d4a6678dd0e50db3dcfb150b5e062e739eab..67412763d64009d47ba3b51b110819b1474f3317 100644 (file)
@@ -137,7 +137,7 @@ import (
 // string, an integer type, or implement encoding.TextMarshaler. The map keys
 // 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
+//   - keys of any string type are used directly
 //   - encoding.TextMarshalers are marshaled
 //   - integer keys are converted to strings
 //