enable errorlint linter

This commit is contained in:
Matthieu MOREL
2021-11-24 09:14:02 +11:00
committed by Mike Farah
parent 3f4bbf748d
commit 8711042c98
8 changed files with 22 additions and 17 deletions
+3 -2
View File
@@ -2,6 +2,7 @@ package yqlib
import (
"bufio"
"errors"
"io"
"os"
)
@@ -63,7 +64,7 @@ func (f *frontMatterHandlerImpl) Split() error {
for {
peekBytes, err := reader.Peek(3)
if err == io.EOF {
if errors.Is(err, io.EOF) {
// we've finished reading the yaml content..I guess
break
} else if err != nil {
@@ -75,7 +76,7 @@ func (f *frontMatterHandlerImpl) Split() error {
}
line, errReading := reader.ReadString('\n')
lineCount = lineCount + 1
if errReading != nil && errReading != io.EOF {
if errReading != nil && !errors.Is(errReading, io.EOF) {
return errReading
}