mirror of https://github.com/docker/cli.git
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 <github@gone.nl>
This commit is contained in:
parent
7c4b63b1c3
commit
2ec424a2d9
|
@ -152,6 +152,7 @@ func TestInitializeFromClient(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, testcase := range testcases {
|
for _, testcase := range testcases {
|
||||||
|
testcase := testcase
|
||||||
t.Run(testcase.doc, func(t *testing.T) {
|
t.Run(testcase.doc, func(t *testing.T) {
|
||||||
apiclient := &fakeClient{
|
apiclient := &fakeClient{
|
||||||
pingFunc: testcase.pingFunc,
|
pingFunc: testcase.pingFunc,
|
||||||
|
@ -189,6 +190,7 @@ func TestExperimentalCLI(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, testcase := range testcases {
|
for _, testcase := range testcases {
|
||||||
|
testcase := testcase
|
||||||
t.Run(testcase.doc, func(t *testing.T) {
|
t.Run(testcase.doc, func(t *testing.T) {
|
||||||
dir := fs.NewDir(t, testcase.doc, fs.WithFile("config.json", testcase.configfile))
|
dir := fs.NewDir(t, testcase.doc, fs.WithFile("config.json", testcase.configfile))
|
||||||
defer dir.Remove()
|
defer dir.Remove()
|
||||||
|
@ -242,6 +244,7 @@ func TestGetClientWithPassword(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, testcase := range testcases {
|
for _, testcase := range testcases {
|
||||||
|
testcase := testcase
|
||||||
t.Run(testcase.doc, func(t *testing.T) {
|
t.Run(testcase.doc, func(t *testing.T) {
|
||||||
passRetriever := func(_, _ string, _ bool, attempts int) (passphrase string, giveup bool, err error) {
|
passRetriever := func(_, _ string, _ bool, attempts int) (passphrase string, giveup bool, err error) {
|
||||||
// Always return an invalid pass first to test iteration
|
// Always return an invalid pass first to test iteration
|
||||||
|
|
Loading…
Reference in New Issue