Pārlūkot izejas kodu

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.
allen 5 gadi atpakaļ
vecāks
revīzija
cd6773e694
1 mainītis faili ar 0 papildinājumiem un 4 dzēšanām
  1. 0 4
      reflect_map.go

+ 0 - 4
reflect_map.go

@@ -167,10 +167,6 @@ func (decoder *mapDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
 	if c == '}' {
 		return
 	}
-	if c != '"' {
-		iter.ReportError("ReadMapCB", `expect " after }, but found `+string([]byte{c}))
-		return
-	}
 	iter.unreadByte()
 	key := decoder.keyType.UnsafeNew()
 	decoder.keyDecoder.Decode(key, iter)