Skip to content

Commit 8d553c0

Browse files
committed
mountinfo: fix QF1001 (staticcheck)
Error: mountinfo/mounted_linux_test.go:282:6: QF1001: could apply De Morgan's law (staticcheck) if !(tc.isNotExist && errors.Is(err, os.ErrNotExist)) { ^ Error: mountinfo/mounted_linux_test.go:353:8: QF1001: could apply De Morgan's law (staticcheck) if !(tc.isNotExist && errors.Is(err, os.ErrNotExist)) { ^ Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 6e2523c commit 8d553c0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: mountinfo/mounted_linux_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ func testMountedFast(t *testing.T, path string, tc *testMount, openat2Supported
279279
mounted, sure, err := MountedFast(path)
280280
if err != nil {
281281
// Got an error; is it expected?
282-
if !(tc.isNotExist && errors.Is(err, os.ErrNotExist)) {
282+
if !tc.isNotExist || !errors.Is(err, os.ErrNotExist) {
283283
t.Errorf("MountedFast: unexpected error: %v", err)
284284
}
285285

@@ -350,7 +350,7 @@ func TestMountedBy(t *testing.T) {
350350
}
351351
} else {
352352
// Got an error; is it expected?
353-
if !(tc.isNotExist && errors.Is(err, os.ErrNotExist)) {
353+
if !tc.isNotExist || !errors.Is(err, os.ErrNotExist) {
354354
t.Errorf("Mounted: unexpected error: %v", err)
355355
}
356356
// Check false is returned in error case.

0 commit comments

Comments
 (0)