chore: refactor log limit in rest (#3572)

This commit is contained in:
Kevin Wan
2023-09-16 22:33:30 +08:00
committed by GitHub
parent cc21f5fae2
commit 0dcede6457
7 changed files with 50 additions and 15 deletions

View File

@@ -2,6 +2,7 @@ package iox
import (
"bytes"
"errors"
"io"
"os"
)
@@ -26,7 +27,7 @@ func CountLines(file string) (int, error) {
count += bytes.Count(buf[:c], lineSep)
switch {
case err == io.EOF:
case errors.Is(err, io.EOF):
if noEol {
count++
}