]> Cypherpunks repositories - gostls13.git/commitdiff
testing: remove redundant variable capture from subtest example
authorJake Bailey <jacob.b.bailey@gmail.com>
Sat, 22 Mar 2025 05:34:52 +0000 (22:34 -0700)
committerGopher Robot <gobot@golang.org>
Mon, 24 Mar 2025 17:16:54 +0000 (10:16 -0700)
Loop variable capturing hasn't been needed like this since Go 1.21;
remove it from the example.

Change-Id: I231dcfdb57832e32d524f156a605ba36d1c9d6d9
Reviewed-on: https://go-review.googlesource.com/c/go/+/660176
Reviewed-by: Alan Donovan <adonovan@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
src/testing/testing.go

index 471046e89d948e5f876fca95796399170c7c0051..5b0a33f28d4db2c6083651cf188e753534950374 100644 (file)
 //
 //     func TestGroupedParallel(t *testing.T) {
 //         for _, tc := range tests {
-//             tc := tc // capture range variable
 //             t.Run(tc.Name, func(t *testing.T) {
 //                 t.Parallel()
 //                 ...