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

@@ -16,8 +16,6 @@
package cmd
import "os"
// errUnexpected - unexpected error, requires manual intervention.
var errUnexpected = StorageErr("unexpected error, please report this issue at https://github.com/minio/minio/issues")
@@ -127,10 +125,10 @@ func osErrToFileErr(err error) error {
if err == nil {
return nil
}
if os.IsNotExist(err) {
if osIsNotExist(err) {
return errFileNotFound
}
if os.IsPermission(err) {
if osIsPermission(err) {
return errFileAccessDenied
}
if isSysErrNotDir(err) {