File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -183,7 +183,7 @@ func DepErrors(pkgpath string, flags ...string) bool {
183183// FileExists tests whether the file at `filename` exists and is not a directory.
184184func FileExists (filename string ) bool {
185185 info , err := os .Stat (filename )
186- if err != nil && ! os . IsNotExist (err ) {
186+ if err != nil && ! errors . Is (err , fs . ErrNotExist ) {
187187 log .Printf ("Unable to stat %s: %s\n " , filename , err .Error ())
188188 }
189189 return err == nil && ! info .IsDir ()
@@ -192,7 +192,7 @@ func FileExists(filename string) bool {
192192// DirExists tests whether `filename` exists and is a directory.
193193func DirExists (filename string ) bool {
194194 info , err := os .Stat (filename )
195- if err != nil && ! os . IsNotExist (err ) {
195+ if err != nil && ! errors . Is (err , fs . ErrNotExist ) {
196196 log .Printf ("Unable to stat %s: %s\n " , filename , err .Error ())
197197 }
198198 return err == nil && info .IsDir ()
You can’t perform that action at this time.
0 commit comments