Skip to content

Commit 603fb5f

Browse files
committed
net: remove unnecessary loop variable copies in tests
Similar to CL 711640.
1 parent 5241d11 commit 603fb5f

File tree

3 files changed

+0
-4
lines changed

3 files changed

+0
-4
lines changed

src/net/lookup_windows_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ func toJson(v any) string {
3030

3131
func testLookup(t *testing.T, fn func(*testing.T, *Resolver, string)) {
3232
for _, def := range []bool{true, false} {
33-
def := def
3433
for _, server := range nslookupTestServers {
35-
server := server
3634
var name string
3735
if def {
3836
name = "default/"

src/net/unixsock_windows_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ func TestUnixConnLocalWindows(t *testing.T) {
2020
}
2121
handler := func(ls *localServer, ln Listener) {}
2222
for _, laddr := range []string{"", testUnixAddr(t)} {
23-
laddr := laddr
2423
taddr := testUnixAddr(t)
2524
ta, err := ResolveUnixAddr("unix", taddr)
2625
if err != nil {

src/net/url/url_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,6 @@ func TestURLRedacted(t *testing.T) {
876876
}
877877

878878
for _, tt := range cases {
879-
t := t
880879
t.Run(tt.name, func(t *testing.T) {
881880
if g, w := tt.url.Redacted(), tt.want; g != w {
882881
t.Fatalf("got: %q\nwant: %q", g, w)

0 commit comments

Comments
 (0)