]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: fix loop variable capturing in TestDeadcode
authorCherry Zhang <cherryyz@google.com>
Tue, 5 May 2020 20:20:56 +0000 (16:20 -0400)
committerCherry Zhang <cherryyz@google.com>
Tue, 5 May 2020 20:36:42 +0000 (20:36 +0000)
Fixes #38884.

Change-Id: Id5ab9977b6404d0dbf71f13e3e4fefb6868ac802
Reviewed-on: https://go-review.googlesource.com/c/go/+/232377
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/cmd/link/internal/ld/deadcode_test.go

index 23a8685bbb626fb60a2926c143233d7779d93c28..460bc16e568e9f2526358165c8f30d5737eaef83 100644 (file)
@@ -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")