From: Eli Bendersky Date: Wed, 31 Jul 2019 20:42:16 +0000 (-0700) Subject: encoding/json: clarify Marshal behavior for string keys of maps X-Git-Tag: go1.13rc1~54 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=e81b7315927d025a1eb3933542211b899880b982;p=gostls13.git encoding/json: clarify Marshal behavior for string keys of maps 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 --- diff --git a/src/encoding/json/encode.go b/src/encoding/json/encode.go index 3474d4a667..67412763d6 100644 --- a/src/encoding/json/encode.go +++ b/src/encoding/json/encode.go @@ -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 //