How do I parse ndjson file using Golang? [duplicate]
问题 This question already has answers here : Parsing multiple JSON objects in Go (4 answers) Closed last year . I have a ndjson (newline delimited JSON) file, I need to parse it and get the data for some logical operation. Is there any good method for parsing ndjson files using golang. A sample ndjson is given below {"a":"1","b":"2","c":[{"d":"100","e":"10"}]} {"a":"2","b":"2","c":[{"d":"101","e":"11"}]} {"a":"3","b":"2","c":[{"d":"102","e":"12"}]} 回答1: The encoding/json Decoder parses sequential