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

#27 support json.Unmarshaler

This commit is contained in:
Tao Wen
2017-05-24 16:04:11 +08:00
parent f6f159e108
commit 7d2ae80c37
4 changed files with 61 additions and 4 deletions

View File

@ -30,6 +30,17 @@ func (iter *Iterator) ReadBool() (ret bool) {
}
func (iter *Iterator) SkipAndReturnBytes() []byte {
if iter.reader != nil {
panic("reader input does not support this api")
}
before := iter.head
iter.Skip()
after := iter.head
return iter.buf[before:after]
}
// Skip skips a json object and positions to relatively the next json object
func (iter *Iterator) Skip() {
c := iter.nextToken()