diff options
| author | Shulhan <ms@kilabit.info> | 2026-01-15 19:21:33 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2026-01-15 19:21:33 +0700 |
| commit | 73252709ac8f73d1be5f9752d5f1dda79a9c85a4 (patch) | |
| tree | fdc2a6ad8ddc15846d1388105e81b8c66895ac7d /file.go | |
| parent | 5247a96c9b0adce5e38460ad2d0ef5028e34b768 (diff) | |
| download | spdxconv-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.go | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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 |
