diff options
| author | Alan Donovan <adonovan@google.com> | 2025-11-11 14:48:22 -0500 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2025-11-11 19:59:40 -0800 |
| commit | 4bfc3a9d14c0b3bfcfe4ce987e47cda6720785a2 (patch) | |
| tree | 0cbf1ec55d3a61af8bf45ac4a00af7e7bcc426db /src/runtime | |
| parent | 2263d4aabdde8a4a466009ecc356501f87c7efb7 (diff) | |
| download | go-4bfc3a9d14c0b3bfcfe4ce987e47cda6720785a2.tar.xz | |
std,cmd: go fix -any std cmd
This change mechanically replaces all occurrences of interface{}
by 'any' (where deemed safe by the 'any' modernizer) throughout
std and cmd, minus their vendor trees.
Since this fix is relatively numerous, it gets its own CL.
Also, 'go generate go/types'.
Change-Id: I14a6b52856c3291c1d27935409bca8d5fd4242a2
Reviewed-on: https://go-review.googlesource.com/c/go/+/719702
Commit-Queue: Alan Donovan <adonovan@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Auto-Submit: Alan Donovan <adonovan@google.com>
Diffstat (limited to 'src/runtime')
| -rw-r--r-- | src/runtime/metrics_test.go | 2 | ||||
| -rw-r--r-- | src/runtime/pprof/pprof_test.go | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/runtime/metrics_test.go b/src/runtime/metrics_test.go index b67424301b..92cec75465 100644 --- a/src/runtime/metrics_test.go +++ b/src/runtime/metrics_test.go @@ -471,7 +471,7 @@ func BenchmarkReadMetricsLatency(b *testing.B) { b.ReportMetric(float64(latencies[len(latencies)*99/100]), "p99-ns") } -var readMetricsSink [1024]interface{} +var readMetricsSink [1024]any func TestReadMetricsCumulative(t *testing.T) { // Set up the set of metrics marked cumulative. diff --git a/src/runtime/pprof/pprof_test.go b/src/runtime/pprof/pprof_test.go index b816833e52..adbd1932a4 100644 --- a/src/runtime/pprof/pprof_test.go +++ b/src/runtime/pprof/pprof_test.go @@ -1627,7 +1627,7 @@ func TestGoroutineProfileConcurrency(t *testing.T) { obj := new(T) ch1, ch2 := make(chan int), make(chan int) defer close(ch2) - runtime.SetFinalizer(obj, func(_ interface{}) { + runtime.SetFinalizer(obj, func(_ any) { close(ch1) <-ch2 }) @@ -1829,7 +1829,7 @@ func TestGoroutineProfileIssue74090(t *testing.T) { var objs []*T for range 10000 { obj := new(T) - runtime.SetFinalizer(obj, func(_ interface{}) {}) + runtime.SetFinalizer(obj, func(_ any) {}) objs = append(objs, obj) } objs = nil |
