Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/cmd/api/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ var warmupCache = sync.OnceFunc(func() {
// Warm up the import cache in parallel.
var wg sync.WaitGroup
for _, context := range contexts {
context := context
wg.Add(1)
go func() {
defer wg.Done()
Expand Down
1 change: 0 additions & 1 deletion src/cmd/cgo/internal/testerrors/errors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ func TestToleratesOptimizationFlag(t *testing.T) {
"",
"-O",
} {
cflags := cflags
t.Run(cflags, func(t *testing.T) {
testenv.MustHaveGoBuild(t)
testenv.MustHaveCGO(t)
Expand Down
1 change: 0 additions & 1 deletion src/cmd/cgo/internal/testsanitizers/asan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ func TestASAN(t *testing.T) {
{src: "arena_fail.go", memoryAccessError: "use-after-poison", errorLocation: "arena_fail.go:26", experiments: []string{"arenas"}},
}
for _, tc := range cases {
tc := tc
name := strings.TrimSuffix(tc.src, ".go")
t.Run(name, func(t *testing.T) {
t.Parallel()
Expand Down
1 change: 0 additions & 1 deletion src/cmd/cgo/internal/testsanitizers/cshared_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ func TestShared(t *testing.T) {
}

for _, tc := range cases {
tc := tc
name := strings.TrimSuffix(tc.src, ".go")
//The memory sanitizer tests require support for the -msan option.
if tc.sanitizer == "memory" && !platform.MSanSupported(GOOS, GOARCH) {
Expand Down
1 change: 0 additions & 1 deletion src/cmd/cgo/internal/testsanitizers/libfuzzer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ func TestLibFuzzer(t *testing.T) {
{goSrc: "libfuzzer2.go", cSrc: "libfuzzer2.c", expectedError: "panic: found it"},
}
for _, tc := range cases {
tc := tc
name := strings.TrimSuffix(tc.goSrc, ".go")
t.Run(name, func(t *testing.T) {
t.Parallel()
Expand Down
1 change: 0 additions & 1 deletion src/cmd/cgo/internal/testsanitizers/msan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ func TestMSAN(t *testing.T) {
{src: "arena_fail.go", wantErr: true, experiments: []string{"arenas"}},
}
for _, tc := range cases {
tc := tc
name := strings.TrimSuffix(tc.src, ".go")
t.Run(name, func(t *testing.T) {
t.Parallel()
Expand Down
1 change: 0 additions & 1 deletion src/cmd/cgo/internal/testsanitizers/tsan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ func TestTSAN(t *testing.T) {
{src: "tsan_tracebackctxt", needsRuntime: true}, // Subdirectory
}
for _, tc := range cases {
tc := tc
name := strings.TrimSuffix(tc.src, ".go")
t.Run(name, func(t *testing.T) {
t.Parallel()
Expand Down
1 change: 0 additions & 1 deletion src/cmd/cgo/internal/teststdio/stdio_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ func TestTestRun(t *testing.T) {
"fib.go",
"hello.go",
} {
file := file
wantFile := strings.Replace(file, ".go", ".out", 1)
t.Run(file, func(t *testing.T) {
cmd := exec.Command(testenv.GoToolPath(t), "run", file)
Expand Down
1 change: 0 additions & 1 deletion src/cmd/compile/internal/test/reproduciblebuilds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ func TestReproducibleBuilds(t *testing.T) {
}
t.Parallel()
for _, test := range tests {
test := test
t.Run(test, func(t *testing.T) {
t.Parallel()
var want []byte
Expand Down
1 change: 0 additions & 1 deletion src/cmd/compile/internal/test/ssa_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ func TestCode(t *testing.T) {

// Now we have a test binary. Run it with all the tests as subtests of this one.
for _, test := range tests {
test := test
if flag == ",softfloat" && !test.usesFloat {
// No point in running the soft float version if the test doesn't use floats.
continue
Expand Down
2 changes: 0 additions & 2 deletions src/cmd/compile/internal/types2/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2420,7 +2420,6 @@ type K = Nested[string]
)
var wg sync.WaitGroup
for i := 0; i < 2; i++ {
i := i
wg.Add(1)
go func() {
defer wg.Done()
Expand Down Expand Up @@ -2599,7 +2598,6 @@ func fn() {
})

for _, test := range tests {
test := test
t.Run(test.name, func(t *testing.T) {
if got := len(idents[test.name]); got != 1 {
t.Fatalf("found %d identifiers named %s, want 1", got, test.name)
Expand Down
1 change: 0 additions & 1 deletion src/cmd/compile/internal/types2/sizes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ func main() {
func TestGCSizes(t *testing.T) {
types2.DefPredeclaredTestFuncs()
for _, tc := range gcSizesTests {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
conf := types2.Config{Importer: defaultImporter(), Sizes: types2.SizesFor("gc", "amd64")}
Expand Down
1 change: 0 additions & 1 deletion src/cmd/compile/internal/types2/stdlib_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ func TestStdlib(t *testing.T) {
var wg sync.WaitGroup

for dir := range dirFiles {
dir := dir

cpulimit <- struct{}{}
wg.Add(1)
Expand Down
1 change: 0 additions & 1 deletion src/cmd/go/go_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1545,7 +1545,6 @@ func TestListTemplateContextFunction(t *testing.T) {
{"ReleaseTags", ""},
{"InstallSuffix", ""},
} {
tt := tt
t.Run(tt.v, func(t *testing.T) {
tg := testgo(t)
tg.parallel()
Expand Down
2 changes: 0 additions & 2 deletions src/cmd/go/internal/modfetch/coderepo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,6 @@ func TestCodeRepoVersions(t *testing.T) {
testenv.MustHaveExternalNetwork(t)

for _, tt := range codeRepoVersionsTests {
tt := tt
t.Run(strings.ReplaceAll(tt.path, "/", "_"), func(t *testing.T) {
if strings.Contains(tt.path, "gopkg.in") {
testenv.SkipFlaky(t, 54503)
Expand Down Expand Up @@ -902,7 +901,6 @@ func TestLatest(t *testing.T) {
for _, tt := range latestTests {
name := strings.ReplaceAll(tt.path, "/", "_")
t.Run(name, func(t *testing.T) {
tt := tt
t.Parallel()
if tt.vcs != "mod" {
testenv.MustHaveExecPath(t, tt.vcs)
Expand Down
1 change: 0 additions & 1 deletion src/cmd/go/internal/modload/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ func TestQuery(t *testing.T) {
}
return nil
}
tt := tt
t.Run(strings.ReplaceAll(tt.path, "/", "_")+"/"+tt.query+"/"+tt.current+"/"+allow, func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 0 additions & 2 deletions src/cmd/go/internal/web/url_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ func TestURLToFilePath(t *testing.T) {
if tc.url == "" {
continue
}
tc := tc

t.Run(tc.url, func(t *testing.T) {
u, err := url.Parse(tc.url)
Expand Down Expand Up @@ -46,7 +45,6 @@ func TestURLFromFilePath(t *testing.T) {
if tc.filePath == "" {
continue
}
tc := tc

t.Run(tc.filePath, func(t *testing.T) {
u, err := urlFromFilePath(tc.filePath)
Expand Down
1 change: 0 additions & 1 deletion src/cmd/go/script_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ func TestScript(t *testing.T) {
t.Fatal(err)
}
for _, file := range files {
file := file
name := strings.TrimSuffix(filepath.Base(file), ".txt")
t.Run(name, func(t *testing.T) {
t.Parallel()
Expand Down
1 change: 0 additions & 1 deletion src/cmd/internal/par/queue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ func TestQueueBacklog(t *testing.T) {
unblock := make(chan struct{})
for i := range started {
started[i] = make(chan struct{})
i := i
q.Add(func() {
close(started[i])
<-unblock
Expand Down
1 change: 0 additions & 1 deletion src/cmd/link/dwarf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ func testDWARF(t *testing.T, buildmode string, expectDWARF bool, env ...string)
t.Parallel()

for _, prog := range []string{"testprog", "testprogcgo"} {
prog := prog
expectDWARF := expectDWARF
if runtime.GOOS == "aix" && prog == "testprogcgo" {
extld := os.Getenv("CC")
Expand Down
1 change: 0 additions & 1 deletion src/cmd/link/internal/ld/deadcode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ func TestDeadcode(t *testing.T) {
[]string{"main.large"}},
}
for _, test := range tests {
test := test
t.Run(test.src, func(t *testing.T) {
t.Parallel()
src := filepath.Join("testdata", "deadcode", test.src+".go")
Expand Down
4 changes: 0 additions & 4 deletions src/cmd/link/internal/ld/dwarf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,6 @@ func main() {}
},
}
for _, tc := range tests {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -473,7 +472,6 @@ func main() {
},
}
for _, tc := range tests {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -555,7 +553,6 @@ func main() {
},
}
for _, tc := range tests {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -1980,7 +1977,6 @@ func TestZeroSizedVariable(t *testing.T) {
// See go.dev/issues/54615.

for _, opt := range []string{NoOpt, DefaultOpt} {
opt := opt
t.Run(opt, func(t *testing.T) {
_, ex := gobuildAndExamine(t, zeroSizedVarProg, opt)

Expand Down
1 change: 0 additions & 1 deletion src/cmd/link/internal/ld/ld_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,6 @@ func main() {
},
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
tempDir := t.TempDir()
Expand Down
1 change: 0 additions & 1 deletion src/cmd/link/link_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1622,7 +1622,6 @@ func TestCheckLinkname(t *testing.T) {
{"badlinkname.go", true},
}
for _, test := range tests {
test := test
t.Run(test.src, func(t *testing.T) {
t.Parallel()
src := "./testdata/linkname/" + test.src
Expand Down
1 change: 0 additions & 1 deletion src/os/os_windows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1234,7 +1234,6 @@ func TestReadlink(t *testing.T) {
{junction: false, dir: false, drive: false, relative: true},
}
for _, tt := range tests {
tt := tt
var name string
if tt.junction {
name = "junction"
Expand Down
1 change: 0 additions & 1 deletion src/runtime/panic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ func TestPanicWithDirectlyPrintableCustomTypes(t *testing.T) {
}

for _, tt := range tests {
t := t
t.Run(tt.name, func(t *testing.T) {
output := runTestProg(t, "testprog", tt.name)
if !strings.HasPrefix(output, tt.wantPanicPrefix) {
Expand Down
1 change: 0 additions & 1 deletion src/runtime/syscall_windows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,6 @@ func TestSyscallN(t *testing.T) {
}

for arglen := 0; arglen <= windows.MaxArgs; arglen++ {
arglen := arglen
t.Run(fmt.Sprintf("arg-%d", arglen), func(t *testing.T) {
t.Parallel()
args := make([]string, arglen)
Expand Down