From 542f80241eab952af1b581ba36e941775d044011 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 --- cli/command/container/create_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cli/command/container/create_test.go b/cli/command/container/create_test.go index fe2651ca47..b0b8d4859e 100644 --- a/cli/command/container/create_test.go +++ b/cli/command/container/create_test.go @@ -108,6 +108,7 @@ func TestCreateContainerImagePullPolicy(t *testing.T) { }, } for _, c := range cases { + c := c pullCounter := 0 client := &fakeClient{ @@ -178,6 +179,7 @@ func TestNewCreateCommandWithContentTrustErrors(t *testing.T) { }, } for _, tc := range testCases { + tc := tc cli := test.NewFakeCli(&fakeClient{ createContainerFunc: func(config *container.Config, hostConfig *container.HostConfig, @@ -236,6 +238,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,