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

View File

@@ -211,7 +211,7 @@ func initFormatFS(ctx context.Context, fsPath string) (rlk *lock.RLockedFile, er
}
isEmpty = fi.Size() == 0
}
if os.IsNotExist(err) || isEmpty {
if osIsNotExist(err) || isEmpty {
if err == nil {
rlk.Close()
}
@@ -306,7 +306,7 @@ func formatFSFixDeploymentID(ctx context.Context, fsFormatPath string) error {
return nil
}
}
if os.IsNotExist(err) {
if osIsNotExist(err) {
return nil
}
if err != nil {