diff --git a/.golangci.yml b/.golangci.yml index 07064a0..d775aad 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -3,3 +3,4 @@ linters: - unconvert - unparam - gofumpt + - errorlint diff --git a/capability_linux.go b/capability_linux.go index 994bb13..b2cfdb2 100644 --- a/capability_linux.go +++ b/capability_linux.go @@ -346,7 +346,7 @@ func (c *capsV3) Apply(kind CapType) (err error) { err = prctl(syscall.PR_CAPBSET_DROP, uintptr(i), 0, 0, 0) if err != nil { // Ignore EINVAL since the capability may not be supported in this system. - if errno, ok := err.(syscall.Errno); ok && errno == syscall.EINVAL { + if err == syscall.EINVAL { //nolint:errorlint // Errors from syscall are bare. err = nil continue } @@ -372,7 +372,7 @@ func (c *capsV3) Apply(kind CapType) (err error) { err = prctl(pr_CAP_AMBIENT, action, uintptr(i), 0, 0) if err != nil { // Ignore EINVAL as not supported on kernels before 4.3 - if errno, ok := err.(syscall.Errno); ok && errno == syscall.EINVAL { + if err == syscall.EINVAL { //nolint:errorlint // Errors from syscall are bare. err = nil continue }