File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -183,7 +183,7 @@ func DepErrors(pkgpath string, flags ...string) bool {
183
183
// FileExists tests whether the file at `filename` exists and is not a directory.
184
184
func FileExists (filename string ) bool {
185
185
info , err := os .Stat (filename )
186
- if err != nil && ! os . IsNotExist (err ) {
186
+ if err != nil && ! errors . Is (err , fs . ErrNotExist ) {
187
187
log .Printf ("Unable to stat %s: %s\n " , filename , err .Error ())
188
188
}
189
189
return err == nil && ! info .IsDir ()
@@ -192,7 +192,7 @@ func FileExists(filename string) bool {
192
192
// DirExists tests whether `filename` exists and is a directory.
193
193
func DirExists (filename string ) bool {
194
194
info , err := os .Stat (filename )
195
- if err != nil && ! os . IsNotExist (err ) {
195
+ if err != nil && ! errors . Is (err , fs . ErrNotExist ) {
196
196
log .Printf ("Unable to stat %s: %s\n " , filename , err .Error ())
197
197
}
198
198
return err == nil && info .IsDir ()
You can’t perform that action at this time.
0 commit comments