json-iterator / go

A high-performance 100% compatible drop-in replacement of "encoding/json"
http://jsoniter.com/migrate-from-go-std.html
MIT License
13.43k stars 1.03k forks source link

iter: add new method ReadObjectAsSlice() #597

Closed giuseppe closed 1 year ago

giuseppe commented 2 years ago

similarly to ReadStringAsSlice(), ReadObjectAsSlice() reads an object from the iterator without converting to the string type.

The result cannot be kept around, as it is valid only until the next read from the iterator.

Signed-off-by: Giuseppe Scrivano gscrivan@redhat.com

giuseppe commented 2 years ago

@taowen @thockin PTAL

giuseppe commented 2 years ago

@cch123 PTAL

giuseppe commented 2 years ago

@AllenX2018 can you please take a look?