mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 16:33:21 +01:00
do not search binary contents for version for go package (#3874)
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
parent
abe5e27b4b
commit
f9d0fa81ab
@ -91,7 +91,7 @@ func defaultGoModDir() string {
|
|||||||
func DefaultMainModuleVersionConfig() MainModuleVersionConfig {
|
func DefaultMainModuleVersionConfig() MainModuleVersionConfig {
|
||||||
return MainModuleVersionConfig{
|
return MainModuleVersionConfig{
|
||||||
FromLDFlags: true,
|
FromLDFlags: true,
|
||||||
FromContents: true,
|
FromContents: false,
|
||||||
FromBuildSettings: true,
|
FromBuildSettings: true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -855,6 +855,14 @@ func TestBuildGoPkgInfo(t *testing.T) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "parse main mod and replace devel with pattern from binary contents",
|
name: "parse main mod and replace devel with pattern from binary contents",
|
||||||
|
cfg: func() *CatalogerConfig {
|
||||||
|
c := DefaultCatalogerConfig()
|
||||||
|
// off by default
|
||||||
|
assert.False(t, c.MainModuleVersion.FromContents)
|
||||||
|
// override to true for this test
|
||||||
|
c.MainModuleVersion.FromContents = true
|
||||||
|
return &c
|
||||||
|
}(),
|
||||||
mod: &extendedBuildInfo{
|
mod: &extendedBuildInfo{
|
||||||
BuildInfo: &debug.BuildInfo{
|
BuildInfo: &debug.BuildInfo{
|
||||||
GoVersion: goCompiledVersion,
|
GoVersion: goCompiledVersion,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user