From be5a3ccb7d22e0df20a6c5c6ff88bb21e83f9eab Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 29 Oct 2019 14:37:37 +0100 Subject: [PATCH] cli/command: Using the variable on range scope `testcase` in function literal (scopelint) ``` cli/command/cli_test.go:157:15: Using the variable on range scope `testcase` in function literal (scopelint) pingFunc: testcase.pingFunc, ^ ``` Signed-off-by: Sebastiaan van Stijn (cherry picked from commit 2ec424a2d998233329e9b8d2914830033aea7837) Signed-off-by: Sebastiaan van Stijn --- cli/command/cli_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cli/command/cli_test.go b/cli/command/cli_test.go index a97702e15e..dcff1bb569 100644 --- a/cli/command/cli_test.go +++ b/cli/command/cli_test.go @@ -152,6 +152,7 @@ func TestInitializeFromClient(t *testing.T) { } for _, testcase := range testcases { + testcase := testcase t.Run(testcase.doc, func(t *testing.T) { apiclient := &fakeClient{ pingFunc: testcase.pingFunc, @@ -189,6 +190,7 @@ func TestExperimentalCLI(t *testing.T) { } for _, testcase := range testcases { + testcase := testcase t.Run(testcase.doc, func(t *testing.T) { dir := fs.NewDir(t, testcase.doc, fs.WithFile("config.json", testcase.configfile)) defer dir.Remove() @@ -242,6 +244,7 @@ func TestGetClientWithPassword(t *testing.T) { } for _, testcase := range testcases { + testcase := testcase t.Run(testcase.doc, func(t *testing.T) { passRetriever := func(_, _ string, _ bool, attempts int) (passphrase string, giveup bool, err error) { // Always return an invalid pass first to test iteration