extractor: modify FileExists to check that the path isn't a directory

This commit is contained in:
Sauyon Lee
2020-05-29 03:41:03 -07:00
parent 3513c352e6
commit 296d2d5fd3

View File

@@ -85,9 +85,9 @@ func GetPkgDir(pkgpath string) string {
// FileExists tests whether the file at `filename` exists.
func FileExists(filename string) bool {
_, err := os.Stat(filename)
info, err := os.Stat(filename)
if err != nil && !os.IsNotExist(err) {
log.Printf("Unable to stat %s: %s\n", filename, err.Error())
}
return err == nil
return err == nil && !info.IsDir()
}