From e81b7315927d025a1eb3933542211b899880b982 Mon Sep 17 00:00:00 2001 From: Eli Bendersky Date: Wed, 31 Jul 2019 13:42:16 -0700 Subject: [PATCH] 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 --- src/encoding/json/encode.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 // -- 2.50.0