Skip to content

Commit 6136f41

Browse files
committed
fs2: ignore staticcheck QF1001 De Morgan law warning
Ignore this: > fs2/memory.go:57:7: QF1001: could apply De Morgan's law (staticcheck) > if !(errors.Is(err, os.ErrNotExist) && (swapStr == "max" || swapStr == "0")) { > ^ Because it its current form, the if condition corresponds to the preceding comment. Signed-off-by: Kir Kolyshkin <[email protected]>
1 parent 315f595 commit 6136f41

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs2/memory.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func setMemory(dirPath string, r *cgroups.Resources) error {
5454
if swapStr != "" {
5555
if err := cgroups.WriteFile(dirPath, "memory.swap.max", swapStr); err != nil {
5656
// If swap is not enabled, silently ignore setting to max or disabling it.
57-
if !(errors.Is(err, os.ErrNotExist) && (swapStr == "max" || swapStr == "0")) {
57+
if !(errors.Is(err, os.ErrNotExist) && (swapStr == "max" || swapStr == "0")) { //nolint:staticcheck // Ignore "QF1001: could apply De Morgan's law".
5858
return err
5959
}
6060
}

0 commit comments

Comments
 (0)