diff --git a/syft/pkg/cataloger/golang/parse_go_bin.go b/syft/pkg/cataloger/golang/parse_go_bin.go index a736b8f51..3ec13dc28 100644 --- a/syft/pkg/cataloger/golang/parse_go_bin.go +++ b/syft/pkg/cataloger/golang/parse_go_bin.go @@ -29,13 +29,11 @@ var ( func makeGoMainPackage(mod *debug.BuildInfo, arch string, location source.Location) pkg.Package { gbs := getBuildSettings(mod.Settings) main := newGoBinaryPackage(&mod.Main, mod.GoVersion, arch, location, gbs) - main.Version = "(devel)" if v, ok := gbs["vcs.revision"]; ok { main.Version = v } - main.SetID() return main } diff --git a/syft/pkg/cataloger/golang/parse_go_bin_test.go b/syft/pkg/cataloger/golang/parse_go_bin_test.go index 19888f79d..9fddb2050 100644 --- a/syft/pkg/cataloger/golang/parse_go_bin_test.go +++ b/syft/pkg/cataloger/golang/parse_go_bin_test.go @@ -213,7 +213,7 @@ func TestBuildGoPkgInfo(t *testing.T) { arch: archDetails, mod: &debug.BuildInfo{ GoVersion: goCompiledVersion, - Main: debug.Module{Path: "github.com/anchore/syft"}, + Main: debug.Module{Path: "github.com/anchore/syft", Version: "(devel)"}, Settings: []debug.BuildSetting{ {Key: "GOARCH", Value: archDetails}, {Key: "GOOS", Value: "darwin"}, @@ -227,7 +227,7 @@ func TestBuildGoPkgInfo(t *testing.T) { arch: archDetails, mod: &debug.BuildInfo{ GoVersion: goCompiledVersion, - Main: debug.Module{Path: "github.com/anchore/syft"}, + Main: debug.Module{Path: "github.com/anchore/syft", Version: "(devel)"}, Settings: []debug.BuildSetting{ {Key: "GOARCH", Value: archDetails}, {Key: "GOOS", Value: "darwin"}, @@ -297,7 +297,7 @@ func TestBuildGoPkgInfo(t *testing.T) { arch: archDetails, mod: &debug.BuildInfo{ GoVersion: goCompiledVersion, - Main: debug.Module{Path: "github.com/anchore/syft"}, + Main: debug.Module{Path: "github.com/anchore/syft", Version: "(devel)"}, Settings: []debug.BuildSetting{ {Key: "GOARCH", Value: archDetails}, {Key: "GOOS", Value: "darwin"},