Even if requested, there is no .go file for unsafe - it comes from the
compiler - so referencing its cover variables will break the compilation
in a command like
go test -coverpkg=all fmt
Fixes #10408.
Change-Id: If92658ef6c29dc020f66ba30b02eaa796f7205e0
Reviewed-on: https://go-review.googlesource.com/8891
Reviewed-by: Russ Cox <rsc@golang.org>
// Mark all the coverage packages for rebuilding with coverage.
for _, p := range testCoverPkgs {
+ // There is nothing to cover in package unsafe; it comes from the compiler.
+ if p.ImportPath == "unsafe" {
+ continue
+ }
p.Stale = true // rebuild
p.fake = true // do not warn about rebuild
p.coverMode = testCoverMode