Skip to content

Commit cd6773e

Browse files
committed
remove quotation check for key when decoding map
we don't need to check if the key is surrounded by quotation. In fact, the key might not be strings if we register an extension to customize the map key encoder/decoder.It may be an integer, float, or even a struct.
1 parent 55287ed commit cd6773e

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

reflect_map.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,6 @@ func (decoder *mapDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
167167
if c == '}' {
168168
return
169169
}
170-
if c != '"' {
171-
iter.ReportError("ReadMapCB", `expect " after }, but found `+string([]byte{c}))
172-
return
173-
}
174170
iter.unreadByte()
175171
key := decoder.keyType.UnsafeNew()
176172
decoder.keyDecoder.Decode(key, iter)

0 commit comments

Comments
 (0)