Skip to content

Commit

Permalink
Moved scanner.eof() call to proper place (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
EinKrebs authored Oct 5, 2021
1 parent feb0fd6 commit b83429b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,12 @@ func (s *streamReader) Load(i int) error {
}
}
s.buf.Write(buf[:n])
if n < neededLen {
if err == io.EOF {
s.finished = true
if code := s.scanner.eof(); code == scanError {
return s.scanner.err
}
}
if err == io.EOF {
s.finished = true
}
return err
}

Expand Down

0 comments on commit b83429b

Please sign in to comment.