Skip to content

Commit

Permalink
linereader: only return written size
Browse files Browse the repository at this point in the history
  • Loading branch information
marctrem committed Sep 12, 2024
1 parent dbeae47 commit 15d8001
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion io/linereader/linereader.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func NewInto(dst *T, reader io.Reader, blockSize uint) {
func (lr *T) Read(dst []byte) (n int, err error) {
n, discarded, err := lr.ReadExtra(dst)
if discarded != 0 {
return n + discarded, errors.New("line too long")
return n, errors.New("line too long")
}
return n, err
}
Expand Down

0 comments on commit 15d8001

Please sign in to comment.