Skip to content

Commit

Permalink
cli/command: Using the variable on range scope testcase in function…
Browse files Browse the repository at this point in the history
… 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 <[email protected]>
  • Loading branch information
thaJeztah committed Oct 31, 2019
1 parent 7c4b63b commit 2ec424a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cli/command/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2ec424a

Please sign in to comment.