Skip to content

Commit 0ac6142

Browse files
committed
Show operational risk table even if empty
1 parent 1fff830 commit 0ac6142

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

utils/results/output/resultwriter.go

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -275,23 +275,17 @@ func PrintViolationsTable(tables formats.ResultsTables, cmdType utils.CommandTyp
275275
if err != nil {
276276
return err
277277
}
278-
if len(tables.OperationalRiskViolationsTable) > 0 {
279-
return coreutils.PrintTable(formats.ConvertOperationalRiskTableRowToScanTableRow(tables.OperationalRiskViolationsTable), "Operational Risk Violations", "No operational risk violations were found", printExtended)
280-
}
281-
} else {
282-
err = coreutils.PrintTable(tables.SecurityViolationsTable, "Security Violations", "No security violations were found", printExtended)
283-
if err != nil {
284-
return err
285-
}
286-
err = coreutils.PrintTable(tables.LicenseViolationsTable, "License Compliance Violations", "No license compliance violations were found", printExtended)
287-
if err != nil {
288-
return err
289-
}
290-
if len(tables.OperationalRiskViolationsTable) > 0 {
291-
return coreutils.PrintTable(tables.OperationalRiskViolationsTable, "Operational Risk Violations", "No operational risk violations were found", printExtended)
292-
}
278+
return coreutils.PrintTable(formats.ConvertOperationalRiskTableRowToScanTableRow(tables.OperationalRiskViolationsTable), "Operational Risk Violations", "No operational risk violations were found", printExtended)
293279
}
294-
return nil
280+
err = coreutils.PrintTable(tables.SecurityViolationsTable, "Security Violations", "No security violations were found", printExtended)
281+
if err != nil {
282+
return err
283+
}
284+
err = coreutils.PrintTable(tables.LicenseViolationsTable, "License Compliance Violations", "No license compliance violations were found", printExtended)
285+
if err != nil {
286+
return err
287+
}
288+
return coreutils.PrintTable(tables.OperationalRiskViolationsTable, "Operational Risk Violations", "No operational risk violations were found", printExtended)
295289
}
296290

297291
// PrintLicensesTable prints the licenses in a table.

0 commit comments

Comments
 (0)