Skip to content

Commit

Permalink
mount: rm unneeded errorlint annotation
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. Remove the annotation that is no longer needed.

Unfortunately, switch on a bare unix error (in mountinfo) still needs to
be annotated (see [2]).

[1] polyfloyd/go-errorlint#47
[2] polyfloyd/go-errorlint#54

Signed-off-by: Kir Kolyshkin <[email protected]>
  • Loading branch information
kolyshkin committed Aug 25, 2023
1 parent 3ab121c commit a317ea2
Showing 1 changed file with 1 addition and 1 deletion.
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

0 comments on commit a317ea2

Please sign in to comment.