Explorar o código

ignore empty files (#965)

Zachary Rice %!s(int64=3) %!d(string=hai) anos
pai
achega
e47867d802
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      detect/detect.go

+ 3 - 0
detect/detect.go

@@ -363,6 +363,9 @@ func (d *Detector) DetectFiles(source string) ([]report.Finding, error) {
 				if fInfo.Name() == ".git" && fInfo.IsDir() {
 					return filepath.SkipDir
 				}
+				if fInfo.Size() == 0 {
+					return nil
+				}
 				if fInfo.Mode().IsRegular() {
 					paths <- path
 				}