From 584a89fe7455470b09643b30bdc3cc55bb75a552 Mon Sep 17 00:00:00 2001 From: cuishuang Date: Fri, 10 Oct 2025 11:47:13 +0800 Subject: [PATCH] all: omit unnecessary reassignment The new version of Go has been optimized, and variables do not need to be reassigned. Change-Id: I0374b049271e53510f2b162f6821fb3595f2c8ff Reviewed-on: https://go-review.googlesource.com/c/go/+/710835 Auto-Submit: Michael Pratt LUCI-TryBot-Result: Go LUCI Reviewed-by: Alan Donovan Reviewed-by: Michael Pratt --- src/encoding/base32/base32_test.go | 1 - src/encoding/xml/marshal_test.go | 1 - src/io/fs/readdir_test.go | 1 - src/testing/iotest/reader_test.go | 1 - 4 files changed, 4 deletions(-) diff --git a/src/encoding/base32/base32_test.go b/src/encoding/base32/base32_test.go index f5d3c49e38..6f8d564def 100644 --- a/src/encoding/base32/base32_test.go +++ b/src/encoding/base32/base32_test.go @@ -709,7 +709,6 @@ func TestBufferedDecodingPadding(t *testing.T) { } for _, testcase := range testcases { - testcase := testcase pr, pw := io.Pipe() go func() { for _, chunk := range testcase.chunks { diff --git a/src/encoding/xml/marshal_test.go b/src/encoding/xml/marshal_test.go index b8bce7170a..6c7e711aac 100644 --- a/src/encoding/xml/marshal_test.go +++ b/src/encoding/xml/marshal_test.go @@ -2561,7 +2561,6 @@ var closeTests = []struct { func TestClose(t *testing.T) { for _, tt := range closeTests { - tt := tt t.Run(tt.desc, func(t *testing.T) { var out strings.Builder enc := NewEncoder(&out) diff --git a/src/io/fs/readdir_test.go b/src/io/fs/readdir_test.go index 4c409ae7a0..b89706b893 100644 --- a/src/io/fs/readdir_test.go +++ b/src/io/fs/readdir_test.go @@ -72,7 +72,6 @@ func TestFileInfoToDirEntry(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.path, func(t *testing.T) { fi, err := Stat(testFs, test.path) if err != nil { diff --git a/src/testing/iotest/reader_test.go b/src/testing/iotest/reader_test.go index 1d222372ca..cecfbfce49 100644 --- a/src/testing/iotest/reader_test.go +++ b/src/testing/iotest/reader_test.go @@ -238,7 +238,6 @@ func TestErrReader(t *testing.T) { } for _, tt := range cases { - tt := tt t.Run(tt.name, func(t *testing.T) { n, err := ErrReader(tt.err).Read(nil) if err != tt.err { -- 2.52.0