fix: further improve go binary classifier, including windows (#4593)

Signed-off-by: Keith Zantow <kzantow@gmail.com>
This commit is contained in:
Keith Zantow
2026-02-03 10:29:00 -05:00
committed by GitHub
parent d22139ef1a
commit add2629446
9 changed files with 43 additions and 4 deletions
@@ -736,6 +736,26 @@ func Test_Cataloger_PositiveCases(t *testing.T) {
Metadata: metadata("go-binary"),
},
},
{
logicalFixture: "go-version-hint/1.15w/any",
expected: pkg.Package{
Name: "go",
Version: "1.15",
PURL: "pkg:generic/go@1.15",
Locations: locations("bin/go.exe", "VERSION"),
Metadata: metadata("go-binary"),
},
},
{
logicalFixture: "go-version-hint/1.21/any",
expected: pkg.Package{
Name: "go",
Version: "1.21",
PURL: "pkg:generic/go@1.21",
Locations: locations("go", "VERSION"),
Metadata: metadata("go-binary"),
},
},
{
// note: this is for compatability with dev version of golang tip image, which resolves the issue #3681
logicalFixture: "go-version-hint/1.25/any",
@@ -747,6 +767,16 @@ func Test_Cataloger_PositiveCases(t *testing.T) {
Metadata: metadata("go-binary"),
},
},
{
logicalFixture: "go-version-hint/1.25w/any",
expected: pkg.Package{
Name: "go",
Version: "1.25-d524e1e",
PURL: "pkg:generic/go@1.25-d524e1e",
Locations: locations("go.exe", "VERSION"),
Metadata: metadata("go-binary"),
},
},
{
// note: this is testing BUSYBOX which is typically through a link to "[" (in this case a symlink but in
// practice this is often a hard link).