소스 검색

ignore empty files (#965)

Zachary Rice 3 년 전
부모
커밋
e47867d802
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  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
 				}