From 1405874d0154ca010ad3fe8a61507bcb1c9a1ef1 Mon Sep 17 00:00:00 2001 From: Kioni Date: Wed, 22 May 2024 23:39:33 +0900 Subject: [PATCH] cmd/go: add -cover flag to report by go version -m Fixes #67366 --- src/cmd/go/internal/load/pkg.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cmd/go/internal/load/pkg.go b/src/cmd/go/internal/load/pkg.go index 92b1ea8d67..b5346b1be7 100644 --- a/src/cmd/go/internal/load/pkg.go +++ b/src/cmd/go/internal/load/pkg.go @@ -2349,6 +2349,9 @@ func (p *Package) setBuildInfo(ctx context.Context, autoVCS bool) { appendSetting("-ldflags", ldflags) } } + if cfg.BuildCover { + appendSetting("-cover", "true") + } if cfg.BuildMSan { appendSetting("-msan", "true") }