fix: unwrapping issues with os.Is* functions (#10949)
reduces 3 stat calls, reducing the overall startup time significantly.
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user