@@ -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