fix(lint): use errors.Is for io.EOF comparison in sys_linux

The errorlint linter rejects direct error comparison with != because it
fails on wrapped errors. Compare via errors.Is(err, io.EOF) instead.
This commit is contained in:
MHSanaei
2026-06-27 16:38:07 +02:00
parent 9b8a0c9b17
commit 56b0be0b6a
+2 -1
View File
@@ -4,6 +4,7 @@ package sys
import (
"bufio"
"errors"
"fmt"
"io"
"os"
@@ -93,7 +94,7 @@ func CPUPercentRaw() (float64, error) {
rd := bufio.NewReader(f)
line, err := rd.ReadString('\n')
if err != nil && err != io.EOF {
if err != nil && !errors.Is(err, io.EOF) {
return 0, err
}
// Expect: cpu user nice system idle iowait irq softirq steal guest guest_nice