Skip to content

Commit 5ca9a12

Browse files
committed
all: remove unneeded loop variables in tests
Fixes#76411
1 parent 337f7b1 commit 5ca9a12

File tree

27 files changed

+0
-33
lines changed

27 files changed

+0
-33
lines changed

‎src/cmd/api/api_test.go‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,6 @@ var warmupCache = sync.OnceFunc(func(){
232232
// Warm up the import cache in parallel.
233233
varwg sync.WaitGroup
234234
for_, context:=rangecontexts{
235-
context:=context
236235
wg.Add(1)
237236
gofunc(){
238237
deferwg.Done()

‎src/cmd/cgo/internal/testerrors/errors_test.go‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ func TestToleratesOptimizationFlag(t *testing.T){
152152
"",
153153
"-O",
154154
}{
155-
cflags:=cflags
156155
t.Run(cflags, func(t*testing.T){
157156
testenv.MustHaveGoBuild(t)
158157
testenv.MustHaveCGO(t)

‎src/cmd/cgo/internal/testsanitizers/asan_test.go‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ func TestASAN(t *testing.T){
4848
{src: "arena_fail.go", memoryAccessError: "use-after-poison", errorLocation: "arena_fail.go:26", experiments: []string{"arenas"}},
4949
}
5050
for_, tc:=rangecases{
51-
tc:=tc
5251
name:=strings.TrimSuffix(tc.src, ".go")
5352
t.Run(name, func(t*testing.T){
5453
t.Parallel()

‎src/cmd/cgo/internal/testsanitizers/cshared_test.go‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ func TestShared(t *testing.T){
5454
}
5555

5656
for_, tc:=rangecases{
57-
tc:=tc
5857
name:=strings.TrimSuffix(tc.src, ".go")
5958
//The memory sanitizer tests require support for the -msan option.
6059
iftc.sanitizer=="memory"&&!platform.MSanSupported(GOOS, GOARCH){

‎src/cmd/cgo/internal/testsanitizers/libfuzzer_test.go‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ func TestLibFuzzer(t *testing.T){
4343
{goSrc: "libfuzzer2.go", cSrc: "libfuzzer2.c", expectedError: "panic: found it"},
4444
}
4545
for_, tc:=rangecases{
46-
tc:=tc
4746
name:=strings.TrimSuffix(tc.goSrc, ".go")
4847
t.Run(name, func(t*testing.T){
4948
t.Parallel()

‎src/cmd/cgo/internal/testsanitizers/msan_test.go‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ func TestMSAN(t *testing.T){
6262
{src: "arena_fail.go", wantErr: true, experiments: []string{"arenas"}},
6363
}
6464
for_, tc:=rangecases{
65-
tc:=tc
6665
name:=strings.TrimSuffix(tc.src, ".go")
6766
t.Run(name, func(t*testing.T){
6867
t.Parallel()

‎src/cmd/cgo/internal/testsanitizers/tsan_test.go‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ func TestTSAN(t *testing.T){
5959
{src: "tsan_tracebackctxt", needsRuntime: true}, // Subdirectory
6060
}
6161
for_, tc:=rangecases{
62-
tc:=tc
6362
name:=strings.TrimSuffix(tc.src, ".go")
6463
t.Run(name, func(t*testing.T){
6564
t.Parallel()

‎src/cmd/cgo/internal/teststdio/stdio_test.go‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ func TestTestRun(t *testing.T){
5656
"fib.go",
5757
"hello.go",
5858
}{
59-
file:=file
6059
wantFile:=strings.Replace(file, ".go", ".out", 1)
6160
t.Run(file, func(t*testing.T){
6261
cmd:=exec.Command(testenv.GoToolPath(t), "run", file)

‎src/cmd/compile/internal/test/reproduciblebuilds_test.go‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ func TestReproducibleBuilds(t *testing.T){
2626
}
2727
t.Parallel()
2828
for_, test:=rangetests{
29-
test:=test
3029
t.Run(test, func(t*testing.T){
3130
t.Parallel()
3231
varwant []byte

‎src/cmd/compile/internal/test/ssa_test.go‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ func TestCode(t *testing.T){
163163

164164
// Now we have a test binary. Run it with all the tests as subtests of this one.
165165
for_, test:=rangetests{
166-
test:=test
167166
ifflag==",softfloat"&&!test.usesFloat{
168167
// No point in running the soft float version if the test doesn't use floats.
169168
continue

0 commit comments

Comments
(0)