]> Cypherpunks.ru repositories - goredo.git/blobdiff - ood.go
Shorter declaration
[goredo.git] / ood.go
diff --git a/ood.go b/ood.go
index 8f3d7798d8ccf718b0e5ae8b9052b179e8ea7ade..52be37be889f5074fd987948b5fdd5e9fa7e2d08 100644 (file)
--- a/ood.go
+++ b/ood.go
@@ -23,6 +23,7 @@ import (
        "errors"
        "fmt"
        "io"
+       "io/fs"
        "log"
        "os"
        "path"
@@ -46,8 +47,8 @@ var (
        FdOODTgts     *os.File
        FdOODTgtsLock *os.File
 
-       OODCache        map[string]bool = make(map[string]bool)
-       FileExistsCache map[string]bool = make(map[string]bool)
+       OODCache        = make(map[string]bool)
+       FileExistsCache = make(map[string]bool)
 
        ErrMissingTarget = errors.New("invalid format of .rec: missing Target")
 )
@@ -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