Projects STRLCPY syft Commits 11e926ab
🤬
Revision indexing in progress... (symbol navigation in revisions will be accurate after indexed)
  • ■ ■ ■ ■ ■
    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
  • ■ ■ ■ ■ ■ ■
    syft/formats/common/spdxhelpers/to_format_model_test.go
    skipped 472 lines
    473 473   },
    474 474   expected: []*spdx.OtherLicense{
    475 475   {
    476  - LicenseIdentifier: "LicenseRef-un-known",
    477  - LicenseName: "un known",
     476 + LicenseIdentifier: "LicenseRef-not-known--s",
     477 + LicenseName: "not known %s",
    478 478   ExtractedText: NONE,
    479 479   },
    480 480   {
    481  - LicenseIdentifier: "LicenseRef-not-known--s",
    482  - LicenseName: "not known %s",
     481 + LicenseIdentifier: "LicenseRef-un-known",
     482 + LicenseName: "un known",
    483 483   ExtractedText: NONE,
    484 484   },
    485 485   },
    skipped 13 lines
Please wait...
Page is in error, reload to recover