cmd/cover: inconsistent treatment of main package in coverage reports #57169
Labels
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
okay-after-rc1
Used by release team to mark a release-blocker issue as okay to resolve either before or after rc1
release-blocker
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
No, only with Go 1.20 / tip.
What operating system and processor architecture are you using (
go env
)?linux/amd64
What did you do?
Here is a small program that has a main function and a test.
Try the following with it:
What did you expect to see?
Identical results for both runs.
What did you see instead?
Note the discrepancy with the package name. For
go test -cover
we get the import path (which seems correct), but for thego build -cover
we're getting the package name and not import path. Seems that these two should be consistent.The text was updated successfully, but these errors were encountered: