■ ■ ■ ■ ■ ■
syft/formats/common/spdxhelpers/to_format_model.go
| skipped 8 lines |
9 | 9 | | "time" |
10 | 10 | | |
11 | 11 | | "github.com/spdx/tools-golang/spdx" |
| 12 | + | "golang.org/x/exp/maps" |
| 13 | + | "golang.org/x/exp/slices" |
12 | 14 | | |
13 | 15 | | "github.com/anchore/syft/internal" |
14 | 16 | | "github.com/anchore/syft/internal/log" |
| skipped 506 lines |
521 | 523 | | } |
522 | 524 | | } |
523 | 525 | | } |
| 526 | + | |
524 | 527 | | var result []*spdx.OtherLicense |
525 | | - | for license := range licenses { |
| 528 | + | |
| 529 | + | sorted := maps.Keys(licenses) |
| 530 | + | slices.Sort(sorted) |
| 531 | + | for _, license := range sorted { |
526 | 532 | | // separate the actual ID from the prefix |
527 | 533 | | name := strings.TrimPrefix(license, spdxlicense.LicenseRefPrefix) |
528 | 534 | | result = append(result, &spdx.OtherLicense{ |
| skipped 60 lines |