Descriptionencoding/json: Marshal a map with numeric keys.
Json package only accept a string keys map to encode currently.
There will be an error when encoding a map with numeric keys.
Eg. [http://play.golang.org/p/11oo0H0NtE]
got "json: unsupported type: map[int]string"
In developing, it is common that using a map with numeric keys.
Then we must copy & convert numbers into strings befor encoding into json.
It is not convenient.
This patch was created for encoding the map with numeric keys into json.
Sorry for my English. Hope I have explained it clearly.
Patch Set 1 #Patch Set 2 : diff -r 7abccc974354 https://code.google.com/p/go #Patch Set 3 : diff -r 7abccc974354 https://code.google.com/p/go #
MessagesTotal messages: 2
|
||||||||||||||||||||||||||||