optimize: logparser v5

This commit is contained in:
Inanc Gumus
2019-08-29 18:27:31 +03:00
parent 661e018258
commit c8e7f3efda
4 changed files with 15 additions and 9 deletions

View File

@ -26,11 +26,12 @@ func NewJSONLog(r io.Reader) *JSON {
func (j *JSON) Each(yield func(Record) error) error {
defer readClose(j.reader)
// Use the same record for unmarshaling.
var r Record
dec := json.NewDecoder(j.reader)
for {
var r Record
err := dec.Decode(&r)
if err == io.EOF {
break