From 15d8001923a9a81e28864de4b67dd49b7c029e80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Tremblay?= <1619947+marctrem@users.noreply.github.com> Date: Thu, 12 Sep 2024 18:13:23 +0000 Subject: [PATCH] linereader: only return written size --- io/linereader/linereader.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/io/linereader/linereader.go b/io/linereader/linereader.go index e60719b..b0f2174 100644 --- a/io/linereader/linereader.go +++ b/io/linereader/linereader.go @@ -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 }