mirror of
https://github.com/github/codeql.git
synced 2026-01-29 06:12:58 +01:00
extractor: modify FileExists to check that the path isn't a directory
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user