fix: unwrapping issues with os.Is* functions (#10949)

reduces  3 stat calls, reducing the
overall startup time significantly.
This commit is contained in:
Harshavardhana
2020-11-23 08:36:49 -08:00
committed by GitHub
parent 39f3d5493b
commit df93102235
22 changed files with 158 additions and 166 deletions
+2 -2
View File
@@ -538,11 +538,11 @@ func TestFSRemoveMeta(t *testing.T) {
t.Fatalf("Unable to remove file, %s", err)
}
if _, err := os.Stat((filePath)); !os.IsNotExist(err) {
if _, err := os.Stat((filePath)); !osIsNotExist(err) {
t.Fatalf("`%s` file found though it should have been deleted.", filePath)
}
if _, err := os.Stat((path.Dir(filePath))); !os.IsNotExist(err) {
if _, err := os.Stat((path.Dir(filePath))); !osIsNotExist(err) {
t.Fatalf("`%s` parent directory found though it should have been deleted.", filePath)
}
}