Skip to content

Commit

Permalink
Merge pull request #9 from kolyshkin/errorlint
Browse files Browse the repository at this point in the history
ci: add errorlint
  • Loading branch information
kolyshkin authored Jul 31, 2024
2 parents 9289123 + 338d3c8 commit 271809a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ linters:
- unconvert
- unparam
- gofumpt
- errorlint
4 changes: 2 additions & 2 deletions capability_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
}
Expand Down

0 comments on commit 271809a

Please sign in to comment.