mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 16:33:21 +01:00
read Go main module version as is - (devel) (#981)
* read Go main module version as is - (devel) Signed-off-by: Jonas Galvão Xavier <jonasx@anchore.com> * fix package test with default (devel) main module Signed-off-by: Jonas Galvão Xavier <jonasx@anchore.com>
This commit is contained in:
parent
37927b8b23
commit
ab289933da
@ -29,12 +29,13 @@ 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 = ""
|
||||
main.Version = "(devel)"
|
||||
|
||||
if v, ok := gbs["vcs.revision"]; ok {
|
||||
main.Version = v
|
||||
}
|
||||
|
||||
main.SetID()
|
||||
return main
|
||||
}
|
||||
|
||||
|
||||
@ -133,6 +133,7 @@ func TestBuildGoPkgInfo(t *testing.T) {
|
||||
FoundBy: catalogerName,
|
||||
Language: pkg.Go,
|
||||
Type: pkg.GoModulePkg,
|
||||
Version: "(devel)",
|
||||
Locations: source.NewLocationSet(
|
||||
source.Location{
|
||||
Coordinates: source.Coordinates{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user