fix: only show severity total from filter flags (#559)

* Add filter table output by severity flags

* Simplify filter output

* Fix unit test

* add filter unique severities

* remove wrong comment

* Remove utils and update logic

* chore(mod): tidy

Co-authored-by: knqyf263 <knqyf263@gmail.com>
This commit is contained in:
Moch. Lutfi
2020-07-29 14:54:51 +07:00
committed by GitHub
parent 4a34f72f22
commit 469c0b41df
5 changed files with 22 additions and 13 deletions

View File

@@ -95,7 +95,7 @@ func run(c config.Config, initializeScanner InitializeScanner) error {
results[i].Vulnerabilities = vulns
}
if err = report.WriteResults(c.Format, c.Output, results, c.Template, c.Light); err != nil {
if err = report.WriteResults(c.Format, c.Output, c.Severities, results, c.Template, c.Light); err != nil {
return xerrors.Errorf("unable to write results: %w", err)
}

View File

@@ -88,7 +88,7 @@ func run(c config.Config) (err error) {
results[i].Vulnerabilities = vulns
}
if err = report.WriteResults(c.Format, c.Output, results, c.Template, false); err != nil {
if err = report.WriteResults(c.Format, c.Output, c.Severities, results, c.Template, false); err != nil {
return xerrors.Errorf("unable to write results: %w", err)
}