File tree 2 files changed +6
-2
lines changed
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ import (
36
36
"os"
37
37
"path/filepath"
38
38
"strings"
39
+ "syscall"
39
40
"time"
40
41
41
42
"github.com/pkg/errors"
@@ -274,6 +275,9 @@ func (p *Path) ExistCheck() (bool, error) {
274
275
if os .IsNotExist (err ) {
275
276
return false , nil
276
277
}
278
+ if err .(* os.PathError ).Err == syscall .ENOTDIR {
279
+ return false , nil
280
+ }
277
281
return false , err
278
282
}
279
283
Original file line number Diff line number Diff line change @@ -106,9 +106,9 @@ func TestPath(t *testing.T) {
106
106
require .False (t , anotherFilePath .IsNotDir ())
107
107
exist , err = anotherFilePath .ExistCheck ()
108
108
require .False (t , exist )
109
- require .Error (t , err )
109
+ require .NoError (t , err )
110
110
require .False (t , anotherFilePath .Exist ())
111
- require .False (t , anotherFilePath .NotExist ())
111
+ require .True (t , anotherFilePath .NotExist ())
112
112
113
113
list , err := folderPath .ReadDir ()
114
114
require .NoError (t , err )
You can’t perform that action at this time.
0 commit comments