diff options
Diffstat (limited to 'src/cmd/go/pkg.go')
-rw-r--r-- | src/cmd/go/pkg.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cmd/go/pkg.go b/src/cmd/go/pkg.go index 98e722b9f5..d69fa5118f 100644 --- a/src/cmd/go/pkg.go +++ b/src/cmd/go/pkg.go @@ -955,6 +955,10 @@ func (p *Package) load(stk *importStack, bp *build.Package, err error) *Package if p.Name == "main" && goarch == "arm" { importPaths = append(importPaths, "math") } + // In coverage atomic mode everything depends on sync/atomic. + if testCoverMode == "atomic" && (!p.Standard || (p.ImportPath != "runtime/cgo" && p.ImportPath != "runtime/race" && p.ImportPath != "sync/atomic")) { + importPaths = append(importPaths, "sync/atomic") + } } // Runtime and its internal packages depend on runtime/internal/sys, |