cmd/go: go test -cover doesn't collect the coverage of a second call to m.Run #28651
Labels
GoCommand
cmd/go
help wanted
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I wrote a very simple code to describe the issue. Please see the go files I attached. It seems 'golang cover' only counted the first main thread coverage and cast the coverage of second m.Run() away.
➜ first go test -cover
PASS
coverage: 0.0% of statements
PASS
ok go/test/first 0.013s
What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: