forked from mirror/go-json
fix cursor issue for `skipArray`, `skipValue`
This commit is contained in:
parent
61705df089
commit
3e25104a7c
|
@ -345,6 +345,7 @@ func (s *Stream) skipArray(depth int64) error {
|
||||||
s.cursor = cursor
|
s.cursor = cursor
|
||||||
if s.read() {
|
if s.read() {
|
||||||
_, cursor, p = s.statForRetry()
|
_, cursor, p = s.statForRetry()
|
||||||
|
cursor++
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
return errors.ErrUnexpectedEndOfJSON("string of object", cursor)
|
return errors.ErrUnexpectedEndOfJSON("string of object", cursor)
|
||||||
|
@ -403,6 +404,7 @@ func (s *Stream) skipValue(depth int64) error {
|
||||||
s.cursor = cursor
|
s.cursor = cursor
|
||||||
if s.read() {
|
if s.read() {
|
||||||
_, cursor, p = s.statForRetry()
|
_, cursor, p = s.statForRetry()
|
||||||
|
cursor++
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
return errors.ErrUnexpectedEndOfJSON("value of string", s.totalOffset())
|
return errors.ErrUnexpectedEndOfJSON("value of string", s.totalOffset())
|
||||||
|
|
Loading…
Reference in New Issue