optimize: change err == xx to errors.Is(err, xx) (#3991)

This commit is contained in:
mongobaba
2024-03-09 20:49:16 +08:00
committed by GitHub
parent e9e55125a9
commit 459d3025c5
5 changed files with 8 additions and 5 deletions

View File

@@ -115,7 +115,7 @@ func split(content string) ([]string, error) {
for {
r, _, err := reader.ReadRune()
if err != nil {
if err == io.EOF {
if errors.Is(err, io.EOF) {
if buffer.Len() > 0 {
list = append(list, buffer.String())
}