From b5aefe07e5afe2fd5d49c6a4219cc826b3e4e34e Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Tue, 14 Oct 2025 11:40:26 +0200 Subject: all: remove unnecessary loop variable copies in tests Copying the loop variable is no longer necessary since Go 1.22. Change-Id: Iebb21dac44a20ec200567f1d786f105a4ee4999d Reviewed-on: https://go-review.googlesource.com/c/go/+/711640 Reviewed-by: Florian Lehner Auto-Submit: Damien Neil Reviewed-by: Dmitri Shuralyov Reviewed-by: Damien Neil Auto-Submit: Tobias Klauser LUCI-TryBot-Result: Go LUCI --- src/sync/atomic/value_test.go | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/sync/atomic') diff --git a/src/sync/atomic/value_test.go b/src/sync/atomic/value_test.go index 721da965e3..b8bc8b8851 100644 --- a/src/sync/atomic/value_test.go +++ b/src/sync/atomic/value_test.go @@ -185,7 +185,6 @@ func TestValueSwapConcurrent(t *testing.T) { n = 1000 } for i := uint64(0); i < m*n; i += n { - i := i g.Add(1) go func() { var c uint64 @@ -256,7 +255,6 @@ func TestValueCompareAndSwapConcurrent(t *testing.T) { n = 100 } for i := 0; i < m; i++ { - i := i w.Add(1) go func() { for j := i; j < m*n; runtime.Gosched() { -- cgit v1.3