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:
Alex Goodman
2025-05-09 17:49:17 +00:00
committed by GitHub
parent abe5e27b4b
commit f9d0fa81ab
2 changed files with 9 additions and 1 deletions
+1 -1
View File
@@ -91,7 +91,7 @@ func defaultGoModDir() string {
func DefaultMainModuleVersionConfig() MainModuleVersionConfig {
return MainModuleVersionConfig{
FromLDFlags: true,
FromContents: true,
FromContents: false,
FromBuildSettings: true,
}
}
@@ -855,6 +855,14 @@ func TestBuildGoPkgInfo(t *testing.T) {
},
{
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{
BuildInfo: &debug.BuildInfo{
GoVersion: goCompiledVersion,