From: Cherry Zhang Date: Tue, 5 May 2020 20:20:56 +0000 (-0400) Subject: cmd/link: fix loop variable capturing in TestDeadcode X-Git-Tag: go1.15beta1~226 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=430cee7cd2c2cd4b458fbf2b2dcc4604a3ed8c05;p=gostls13.git cmd/link: fix loop variable capturing in TestDeadcode Fixes #38884. Change-Id: Id5ab9977b6404d0dbf71f13e3e4fefb6868ac802 Reviewed-on: https://go-review.googlesource.com/c/go/+/232377 Run-TryBot: Cherry Zhang Reviewed-by: Bryan C. Mills TryBot-Result: Gobot Gobot --- diff --git a/src/cmd/link/internal/ld/deadcode_test.go b/src/cmd/link/internal/ld/deadcode_test.go index 23a8685bbb..460bc16e56 100644 --- a/src/cmd/link/internal/ld/deadcode_test.go +++ b/src/cmd/link/internal/ld/deadcode_test.go @@ -32,6 +32,7 @@ func TestDeadcode(t *testing.T) { {"typedesc", "type.main.T"}, } for _, test := range tests { + test := test t.Run(test.src, func(t *testing.T) { t.Parallel() src := filepath.Join("testdata", "deadcode", test.src+".go")