-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Using golangci-lint 2.1.6 with errorlint enabled and --fix
:
WARN [runner] Changes related to "errorlint" are skipped for the file "/app/processmanager/processinfo.go": conflicting edits from errorlint and errorlint on /app/processmanager/processinfo.go
first edits:
--- base
+++ errorlint
@@ -628,7 +628,8 @@
// Since listing /proc and opening files in there later is inherently racy,
// we expect to lose the race sometimes and thus expect to hit os.IsNotExist.
pm.mappingStats.errProcNotExist.Add(1)
- } else if e, ok := err.(*os.PathError); ok && e.Err == syscall.ESRCH {
+ } else e := &os.PathError{}
+if errors.As(err, &e){
// If the process exits while reading its /proc/$PID/maps, the kernel will
// return ESRCH. Handle it as if the process did not exist.
pm.mappingStats.errProcESRCH.Add(1)
second edits:
--- base
+++ errorlint
@@ -628,7 +628,7 @@
// Since listing /proc and opening files in there later is inherently racy,
// we expect to lose the race sometimes and thus expect to hit os.IsNotExist.
pm.mappingStats.errProcNotExist.Add(1)
- } else if e, ok := err.(*os.PathError); ok && e.Err == syscall.ESRCH {
+ } else if e, ok := err.(*os.PathError); ok && errors.Is(e.Err, syscall.ESRCH) {
// If the process exits while reading its /proc/$PID/maps, the kernel will
// return ESRCH. Handle it as if the process did not exist.
pm.mappingStats.errProcESRCH.Add(1)
ccoVeille
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working