Skip to content

Commit 263c712

Browse files
Merge pull request #345 from viveksahu26/fix/bsi_ordering
fix reshuffling of section
2 parents 1bdd771 + a8debb3 commit 263c712

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

pkg/compliance/bsi_report.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import (
1818
"encoding/json"
1919
"fmt"
2020
"os"
21-
"sort"
2221
"time"
2322

2423
"github.com/google/uuid"
@@ -158,9 +157,6 @@ func constructSections(dtb *db.DB) []bsiSection {
158157
var sortedSections []bsiSection
159158
var sbomLevelSections []bsiSection
160159
for elementID, group := range sectionsByElementID {
161-
sort.Slice(group, func(i, j int) bool {
162-
return group[i].ID < group[j].ID
163-
})
164160
if elementID == "SBOM" {
165161
sbomLevelSections = group
166162
} else {
@@ -187,14 +183,6 @@ func bsiDetailedReport(dtb *db.DB, fileName string) {
187183

188184
sections := constructSections(dtb)
189185

190-
// Sort sections by ElementId and then by SectionId
191-
sort.Slice(sections, func(i, j int) bool {
192-
if sections[i].ElementID == sections[j].ElementID {
193-
return sections[i].ID < sections[j].ID
194-
}
195-
return sections[i].ElementID < sections[j].ElementID
196-
})
197-
198186
for _, section := range sections {
199187
sectionID := section.ID
200188
if !section.Required {

0 commit comments

Comments
 (0)