mirror of
https://github.com/anchore/syft.git
synced 2026-11-03 07:56:36 +01:00
fix: further improve go binary classifier, including windows (#4593)
Signed-off-by: Keith Zantow <kzantow@gmail.com>
This commit is contained in:
@@ -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).
|
||||
|
||||
Reference in New Issue
Block a user