Skip to content

Commit 28f8f55

Browse files
elibenmvdan
authored andcommitted
encoding/json: clarify Unmarshal behavior for map keys
This is a documentation-only change Fixes #33298 Change-Id: I816058a872b57dc868dff11887214d9de92d9342 Reviewed-on: https://go-review.googlesource.com/c/go/+/188821 Reviewed-by: Daniel Martí <[email protected]> Run-TryBot: Daniel Martí <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
1 parent b12b672 commit 28f8f55

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/encoding/json/decode.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ import (
7272
// use. If the map is nil, Unmarshal allocates a new map. Otherwise Unmarshal
7373
// reuses the existing map, keeping existing entries. Unmarshal then stores
7474
// key-value pairs from the JSON object into the map. The map's key type must
75-
// either be a string, an integer, or implement encoding.TextUnmarshaler.
75+
// either be any string type, an integer, implement json.Unmarshaler, or
76+
// implement encoding.TextUnmarshaler.
7677
//
7778
// If a JSON value is not appropriate for a given target type,
7879
// or if a JSON number overflows the target type, Unmarshal

0 commit comments

Comments
 (0)