X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=do.go;h=4fbb6c9050d6289704f76f871cf0493ff1df63b6;hb=19b13ea1334d377dd9c6a36ea70c9141b8fd447d;hp=c4a569665b51f029aa9161d2cf03238fa6ce20e0;hpb=bf96757828d2ae663f5f54147c0e229f74fc9357;p=goredo.git diff --git a/do.go b/do.go index c4a5696..4fbb6c9 100644 --- a/do.go +++ b/do.go @@ -1,6 +1,6 @@ /* goredo -- djb's redo implementation on pure Go -Copyright (C) 2020-2021 Sergey Matveev +Copyright (C) 2020-2022 Sergey Matveev This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -34,7 +34,7 @@ const ( var TopDir string func existsDo(fdDep *os.File, cwd, pth string) (bool, error) { - if _, err := os.Stat(path.Join(cwd, pth)); err == nil { + if FileExists(path.Join(cwd, pth)) { return true, nil } return false, ifcreate(fdDep, pth) @@ -89,7 +89,7 @@ func findDo(fdDep *os.File, cwd, tgt string) (string, int, error) { if dirAbs == TopDir { break } - if _, err = os.Stat(path.Join(dirAbs, RedoDir, TopFile)); err == nil { + if FileExists(path.Join(dirAbs, RedoDir, TopFile)) { break } if dirAbs == dirAbsPrev {