cmd/go: test -coverpkg: compilation error when file only contains interface definitions #61709
Labels
FrozenDueToAge
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.
What version of Go are you using (
go version
)?What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I try to run unit tests with coverage
I've got multiple packages with executable code in my project. Additionally, there is one package with single file and single interface inside and this very file causes the issue:
What did you expect to see?
Test coverage report
What did you see instead?
Compilation error
Workaround
Error is gone once I add some executable code to api.go. It might be whatever function, even empty and unused:
Possibly related issues:
#17817 cmd/cover: Avoid importing atomic package if not used
#18486 cmd/go: go test -coverpkg=./... -race does not rebuild sync/atomic
The text was updated successfully, but these errors were encountered: