refactor(report): format-csv (#1072)

This commit is contained in:
Kota Kanbe
2020-11-05 21:10:35 +09:00
committed by GitHub
parent ebd3834a35
commit 75fceff5f7
2 changed files with 11 additions and 22 deletions

View File

@@ -98,17 +98,12 @@ func (w LocalFileWriter) Write(rs ...models.ScanResult) (err error) {
}
if c.Conf.FormatCsvList {
var p string
p := path + "_short.csv"
if c.Conf.Diff {
p = path + "_short_diff.csv"
} else {
p = path + "_short.csv"
}
err := formatCsvList(r, p)
if err == "" {
return xerrors.Errorf("Failed to write CSV. path: %s", p)
if err := formatCsvList(r, p); err != nil {
return xerrors.Errorf("Failed to write CSV: %s, %w", p, err)
}
}