]> Cypherpunks repositories - gostls13.git/commit
cmd/cover: fix problems with "go test -covermode=atomic sync/atomic"
authorThan McIntosh <thanm@google.com>
Thu, 22 Dec 2022 19:10:12 +0000 (14:10 -0500)
committerThan McIntosh <thanm@google.com>
Thu, 5 Jan 2023 17:02:45 +0000 (17:02 +0000)
commitd50ea217f6f5668d6a89fb965e36ecf8564a45cf
tree4a7e346ecd08fe00e71968d969184f7109e6dfe1
parentbae7d772e800207ed764b70a9e5963f0c1e8f0aa
cmd/cover: fix problems with "go test -covermode=atomic sync/atomic"

This patch fixes an elderly bug with "go test -covermode=atomic
sync/atomic". Change the cover tool to avoid adding an import of
sync/atomic when processing "sync/atomic" itself in atomic mode;
instead make direct calls to AddUint32/StoreUint32. In addition,
change the go command to avoid injecting an artificial import of
"sync/atomic" for sync/atomic itself.

Fixes #57445.

Change-Id: I8c8fbd0bcf26c8a8607d4806046f826296508c74
Reviewed-on: https://go-review.googlesource.com/c/go/+/459335
Run-TryBot: Than McIntosh <thanm@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/cmd/cover/cover.go
src/cmd/go/internal/test/test.go
src/cmd/go/testdata/script/cover_sync_atomic_import.txt