aboutsummaryrefslogtreecommitdiff
path: root/file.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2026-01-15 19:21:33 +0700
committerShulhan <ms@kilabit.info>2026-01-15 19:21:33 +0700
commit73252709ac8f73d1be5f9752d5f1dda79a9c85a4 (patch)
treefdc2a6ad8ddc15846d1388105e81b8c66895ac7d /file.go
parent5247a96c9b0adce5e38460ad2d0ef5028e34b768 (diff)
downloadspdxconv-73252709ac8f73d1be5f9752d5f1dda79a9c85a4.tar.xz
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.
Diffstat (limited to 'file.go')
-rw-r--r--file.go2
1 files changed, 1 insertions, 1 deletions
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