From 430cee7cd2c2cd4b458fbf2b2dcc4604a3ed8c05 Mon Sep 17 00:00:00 2001 From: Cherry Zhang Date: Tue, 5 May 2020 16:20:56 -0400 Subject: [PATCH] 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 --- src/cmd/link/internal/ld/deadcode_test.go | 1 + 1 file changed, 1 insertion(+) 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")