From d6a52098207d17e40c2247f7893626b5e07045f5 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Thu, 24 Aug 2023 17:52:30 -0700 Subject: [PATCH] mount: rm unneeded errorlint annotation 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] https://github.com/polyfloyd/go-errorlint/pull/47 [2] https://github.com/polyfloyd/go-errorlint/issues/54 Signed-off-by: Kir Kolyshkin --- mount/mount_unix.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mount/mount_unix.go b/mount/mount_unix.go index 181b7ee2..56ca7472 100644 --- a/mount/mount_unix.go +++ b/mount/mount_unix.go @@ -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.