Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
With the added linter, it complains like this: > capability_linux.go:349:22: type assertion on error will fail on wrapped errors. Use errors.As to check for specific errors (errorlint) In fact, errors from syscall.Syscall6 used by prctl are bare Errno values. This means there is no need for a type assertion, so let's remove it: > - if errno, ok := err.(syscall.Errno); ok && errno == syscall.EINVAL { > + if err == syscall.EINVAL { With that change, we're still getting error from the linter, a bit different one: > capability_linux.go:349:9: comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) So, we still need to silence it, by adding a nolint annotation. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
- Loading branch information