From b320feff9b9174bf4e8052e9d3b4a62028f86031 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 29 Oct 2019 14:41:38 +0100 Subject: [PATCH] cli/command/container: Using the variable on range scope `c` in function literal (scopelint) ``` cli/command/container/create_test.go:120:20: Using the variable on range scope `c` in function literal (scopelint) defer func() { c.ResponseCounter++ }() ^ cli/command/container/create_test.go:121:12: Using the variable on range scope `c` in function literal (scopelint) switch c.ResponseCounter { ^ ``` Signed-off-by: Sebastiaan van Stijn (cherry picked from commit 542f80241eab952af1b581ba36e941775d044011) Signed-off-by: Sebastiaan van Stijn --- cli/command/container/create_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cli/command/container/create_test.go b/cli/command/container/create_test.go index 29912d44dc..544943db19 100644 --- a/cli/command/container/create_test.go +++ b/cli/command/container/create_test.go @@ -151,6 +151,7 @@ func TestNewCreateCommandWithContentTrustErrors(t *testing.T) { }, } for _, tc := range testCases { + tc := tc cli := test.NewFakeCli(&fakeClient{ createContainerFunc: func(config *container.Config, hostConfig *container.HostConfig, @@ -209,6 +210,7 @@ func TestNewCreateCommandWithWarnings(t *testing.T) { }, } for _, tc := range testCases { + tc := tc t.Run(tc.name, func(t *testing.T) { cli := test.NewFakeCli(&fakeClient{ createContainerFunc: func(config *container.Config,