Skip to content

Commit

Permalink
mount,mountinfo: rm unneeded errorlint annotations
Browse files Browse the repository at this point in the history
golangci-lint v1.54.2 comes with errorlint v1.4.4, which contains
the fix [1] whitelisting all errno comparisons for errors coming from
x/sys/unix.

Thus, these annotations are no longer necessary. Hooray!

[1] polyfloyd/go-errorlint#47

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
  • Loading branch information
kolyshkin committed Aug 25, 2023
1 parent 3ab121c commit 344c06b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mount/mount_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func Mount(device, target, mType, options string) error {
// a normal unmount. If target is not a mount point, no error is returned.
func Unmount(target string) error {
err := unix.Unmount(target, mntDetach)
if err == nil || err == unix.EINVAL { //nolint:errorlint // unix errors are bare
if err == nil || err == unix.EINVAL {
// Ignore "not mounted" error here. Note the same error
// can be returned if flags are invalid, so this code
// assumes that the flags value is always correct.
Expand Down
2 changes: 1 addition & 1 deletion mountinfo/mounted_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func mountedByOpenat2(path string) (bool, error) {
Resolve: unix.RESOLVE_NO_XDEV,
})
_ = unix.Close(dirfd)
switch err { //nolint:errorlint // unix errors are bare
switch err {
case nil: // definitely not a mount
_ = unix.Close(fd)
return false, nil
Expand Down

0 comments on commit 344c06b

Please sign in to comment.