]> Cypherpunks repositories - gostls13.git/commit
internal/testlog: use atomic.Pointer instead of atomic.Value
authorMateusz Poliwczak <mpoliwczak34@gmail.com>
Sat, 28 Sep 2024 16:50:03 +0000 (16:50 +0000)
committerGopher Robot <gobot@golang.org>
Mon, 30 Sep 2024 12:40:01 +0000 (12:40 +0000)
commit49dd7726a9e2e4371de984871082ea0e3791cbdd
tree4f72573b6c061aab04246a17aae05e253b3f2d71
parent6536c207c2309da7c1c21e3669f8ddf491e31f5b
internal/testlog: use atomic.Pointer instead of atomic.Value

We know the type (*Interface), so we can use the generic atomic.Pointer.
This change also makes sure that concurrent use of SetLogger also
causes a panic, currently it races (Load, then Store).

Change-Id: I6fae5ce0587b37eede2060342c3fcd0cde4386ff
GitHub-Last-Rev: 0c053be03e22d4afcee235a247a377d7bd4d5aea
GitHub-Pull-Request: golang/go#69701
Reviewed-on: https://go-review.googlesource.com/c/go/+/616516
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/internal/testlog/log.go