Skip to content

Commit b83429b

Browse files
authored
Moved scanner.eof() call to proper place (#9)
1 parent feb0fd6 commit b83429b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

reader.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,12 @@ func (s *streamReader) Load(i int) error {
4343
}
4444
}
4545
s.buf.Write(buf[:n])
46-
if n < neededLen {
46+
if err == io.EOF {
47+
s.finished = true
4748
if code := s.scanner.eof(); code == scanError {
4849
return s.scanner.err
4950
}
5051
}
51-
if err == io.EOF {
52-
s.finished = true
53-
}
5452
return err
5553
}
5654

0 commit comments

Comments
 (0)