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 /report.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 'report.go')
| -rw-r--r-- | report.go | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -52,9 +52,14 @@ func newReport() (rep *report) { // loadReport load the [ReportFile] from the current directory. func loadReport() (rep *report, err error) { var logp = `loadReport` + + rep = newReport() var content []byte content, err = os.ReadFile(ReportFile) if err != nil { + if os.IsNotExist(err) { + return rep, nil + } return nil, fmt.Errorf(`%s: %w`, logp, err) } @@ -64,7 +69,6 @@ func loadReport() (rep *report, err error) { csvr.ReuseRecord = true csvr.TrimLeadingSpace = true - rep = newReport() var group string var record []string var f *file |
