From 479592e0cf34f102d2767198e5d909acc1724528 Mon Sep 17 00:00:00 2001 From: RTann Date: Thu, 14 Nov 2024 13:10:22 -0800 Subject: [PATCH] gobin: ignore flags in stdlib version Signed-off-by: RTann --- gobin/exe.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gobin/exe.go b/gobin/exe.go index 21bf612c6..b40c3188b 100644 --- a/gobin/exe.go +++ b/gobin/exe.go @@ -54,7 +54,8 @@ func toPackages(ctx context.Context, out *[]*claircore.Package, p string, r io.R // TODO(hank) The "go version" is documented as the toolchain that produced // the binary, which may be distinct from the version of the stdlib used? // Need to investigate. - runtimeVer, err := ParseVersion(strings.TrimPrefix(bi.GoVersion, "go")) + goVer, _, _ := strings.Cut(strings.TrimPrefix(bi.GoVersion, "go"), " ") + runtimeVer, err := ParseVersion(goVer) switch { case errors.Is(err, nil): case errors.Is(err, ErrInvalidSemVer):