Skip to content

[BUG] [ Iterator returns end of file instead of scanner error] #26

@baki077

Description

@baki077

I got EOF before the real end of my file and reason is that the scanned line exceeded the size of the buffer (bufio.MaxScanTokenSize) So the scanner return false but sets the error into the scanner.Err() return

file pkg/jsonl/iterator.go

In the iterator you don't check if the scanner has an error

//line 92
if it.Scanner.Scan() {
// parse line code
}
// Here you have to check it.Scanner.Err()
// line 122 return nil, io.EOF

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions