Skip to content

Conflicting edits #100

@rockdaboot

Description

@rockdaboot

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) 

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions