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/runtime/mpagealloc_test.go | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src/runtime/mpagealloc_test.go') diff --git a/src/runtime/mpagealloc_test.go b/src/runtime/mpagealloc_test.go index ded7a79922..45badcb260 100644 --- a/src/runtime/mpagealloc_test.go +++ b/src/runtime/mpagealloc_test.go @@ -181,7 +181,6 @@ func TestPageAllocGrow(t *testing.T) { } } for name, v := range tests { - v := v t.Run(name, func(t *testing.T) { // By creating a new pageAlloc, we will // grow it for each chunk defined in x. @@ -678,7 +677,6 @@ func TestPageAllocAlloc(t *testing.T) { } } for name, v := range tests { - v := v t.Run(name, func(t *testing.T) { b := NewPageAlloc(v.before, v.scav) defer FreePageAlloc(b) @@ -705,7 +703,6 @@ func TestPageAllocExhaust(t *testing.T) { t.Skip("skipping because virtual memory is limited; see #36210") } for _, npages := range []uintptr{1, 2, 3, 4, 5, 8, 16, 64, 1024, 1025, 2048, 2049} { - npages := npages t.Run(fmt.Sprintf("%d", npages), func(t *testing.T) { // Construct b. bDesc := make(map[ChunkIdx][]BitRange) @@ -973,7 +970,6 @@ func TestPageAllocFree(t *testing.T) { } } for name, v := range tests { - v := v t.Run(name, func(t *testing.T) { b := NewPageAlloc(v.before, nil) defer FreePageAlloc(b) @@ -1028,7 +1024,6 @@ func TestPageAllocAllocAndFree(t *testing.T) { }, } for name, v := range tests { - v := v t.Run(name, func(t *testing.T) { b := NewPageAlloc(v.init, nil) defer FreePageAlloc(b) -- cgit v1.3