]> Cypherpunks.ru repositories - goredo.git/blobdiff - ood.go
Do not use legacy os.IsNotExist
[goredo.git] / ood.go
diff --git a/ood.go b/ood.go
index 8f3d7798d8ccf718b0e5ae8b9052b179e8ea7ade..1be39573bd4b15e2ad1ada84fec28210e9089337 100644 (file)
--- a/ood.go
+++ b/ood.go
@@ -23,6 +23,7 @@ import (
        "errors"
        "fmt"
        "io"
+       "io/fs"
        "log"
        "os"
        "path"
@@ -61,7 +62,7 @@ func FileExists(p string) bool {
                FileExistsCache[p] = true
                return true
        }
-       if os.IsNotExist(err) {
+       if errors.Is(err, fs.ErrNotExist) {
                FileExistsCache[p] = false
        }
        return false
@@ -176,7 +177,7 @@ func isOOD(cwd, tgtOrig string, level int, seen map[string]struct{}) (bool, erro
 
                inode, err := inodeFromFileByPath(path.Join(cwd, dep))
                if err != nil {
-                       if os.IsNotExist(err) {
+                       if errors.Is(err, fs.ErrNotExist) {
                                tracef(CDebug, "ood: %s%s -> %s: not exists", indent, tgtOrig, dep)
                                ood = true
                                OODCache[path.Join(cwd, dep)] = ood