From 4bfc3a9d14c0b3bfcfe4ce987e47cda6720785a2 Mon Sep 17 00:00:00 2001 From: Alan Donovan Date: Tue, 11 Nov 2025 14:48:22 -0500 Subject: 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 Reviewed-by: Dmitri Shuralyov LUCI-TryBot-Result: Go LUCI Reviewed-by: Dmitri Shuralyov Auto-Submit: Alan Donovan --- src/runtime/metrics_test.go | 2 +- src/runtime/pprof/pprof_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/runtime') 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 -- cgit v1.3-5-g9baa