Skip to content

Commit 584a89f

Browse files
cuishuanggopherbot
authored andcommitted
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 <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Alan Donovan <[email protected]> Reviewed-by: Michael Pratt <[email protected]>
1 parent 69e8279 commit 584a89f

File tree

4 files changed

+0
-4
lines changed

4 files changed

+0
-4
lines changed

src/encoding/base32/base32_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,6 @@ func TestBufferedDecodingPadding(t *testing.T) {
709709
}
710710

711711
for _, testcase := range testcases {
712-
testcase := testcase
713712
pr, pw := io.Pipe()
714713
go func() {
715714
for _, chunk := range testcase.chunks {

src/encoding/xml/marshal_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2561,7 +2561,6 @@ var closeTests = []struct {
25612561

25622562
func TestClose(t *testing.T) {
25632563
for _, tt := range closeTests {
2564-
tt := tt
25652564
t.Run(tt.desc, func(t *testing.T) {
25662565
var out strings.Builder
25672566
enc := NewEncoder(&out)

src/io/fs/readdir_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ func TestFileInfoToDirEntry(t *testing.T) {
7272
}
7373

7474
for _, test := range tests {
75-
test := test
7675
t.Run(test.path, func(t *testing.T) {
7776
fi, err := Stat(testFs, test.path)
7877
if err != nil {

src/testing/iotest/reader_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,6 @@ func TestErrReader(t *testing.T) {
238238
}
239239

240240
for _, tt := range cases {
241-
tt := tt
242241
t.Run(tt.name, func(t *testing.T) {
243242
n, err := ErrReader(tt.err).Read(nil)
244243
if err != tt.err {

0 commit comments

Comments
 (0)