Hello, I am sorry for asking here. Because the Token() is in progress, I couldn't convert this standart codes with jsoniter. What is the right way for streaming on jsoniter?
decoder := json.NewDecoder(jsonFile)
// Read opening file
_, err = decoder.Token()
checkErr(err)
var asset model.Asset
for decoder.More() {
err := decoder.Decode(&asset)
checkErr(err)
assetJSON, err := json.Marshal(asset)
checkErr(err)
}
// Close the file
_, err = decoder.Token()
checkErr(err)
You can try Iterator and its Readxxx functions for streaming. Since I'm not sure what your jsonField and asset look like, I don't have any concrete suggestion. But you can check this test case for example.
Hello, I am sorry for asking here. Because the Token() is in progress, I couldn't convert this standart codes with jsoniter. What is the right way for streaming on jsoniter?