From 73252709ac8f73d1be5f9752d5f1dda79a9c85a4 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Thu, 15 Jan 2026 19:21:33 +0700 Subject: report: do not return an error if report file does not exist When scan running, it will try to load the previous report file to minimize re-scanning of file that has been applied or detected (regular or binary). If the report file does not exist, do not return the error, keep going. --- file.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'file.go') diff --git a/file.go b/file.go index 80780d1..80c369c 100644 --- a/file.go +++ b/file.go @@ -119,7 +119,7 @@ func (f *file) initLines(content []byte, maxLine int) (err error) { f.lines = f.lines[maxLine : nline-maxLine] } - if bytes.HasPrefix(f.topLines[0], []byte(`#!`)) { + if len(f.topLines) != 0 && bytes.HasPrefix(f.topLines[0], []byte(`#!`)) { f.hasSheBang = true } return nil -- cgit v1.3