Skip to content

Commit 1062c9a

Browse files
committed
cmd/go: exclude empty cover package
For golang#43242
1 parent 5a4db10 commit 1062c9a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/cmd/go/internal/test/test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,11 @@ func runTest(ctx context.Context, cmd *base.Command, args []string) {
731731
continue
732732
}
733733

734+
// There is nothing to cover, just make building fail.
735+
if len(p.GoFiles) == 0 && !p.UsesCgo() && !p.UsesSwig() {
736+
continue
737+
}
738+
734739
if haveMatch {
735740
testCoverPkgs = append(testCoverPkgs, p)
736741
}

0 commit comments

Comments
 (0)