1
0
mirror of https://github.com/json-iterator/go.git synced 2025-07-15 23:54:21 +02:00

fixed null in number json tag string (#480)

This commit is contained in:
Nikolay Dubina
2020-08-03 10:12:41 +08:00
committed by GitHub
parent 5bce16d299
commit 9461257643
3 changed files with 11 additions and 0 deletions

View File

@ -1075,6 +1075,11 @@ type stringModeNumberDecoder struct {
}
func (decoder *stringModeNumberDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
if iter.WhatIsNext() == NilValue {
decoder.elemDecoder.Decode(ptr, iter)
return
}
c := iter.nextToken()
if c != '"' {
iter.ReportError("stringModeNumberDecoder", `expect ", but found `+string([]byte{c}))