From d438a420c226e3cf701bac7c43527c31350750d1 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 --- 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") }