mirror of https://github.com/docker/cli.git
e2e: remove redundant capturing of loop vars in tests (copyloopvar)
go1.22 and up now produce a unique variable in loops, tehrefore no longer requiring to capture the variable manually; service/logs/parse_logs_test.go:50:3: The copy of the 'for' variable "tc" can be deleted (Go 1.22+) (copyloopvar) tc := tc ^ Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
20de861134
commit
6489a777e5
|
@ -131,7 +131,6 @@ func TestUnknownGlobal(t *testing.T) {
|
||||||
"separate-val": {"--unknown", "foo", "helloworld"},
|
"separate-val": {"--unknown", "foo", "helloworld"},
|
||||||
"joined-val": {"--unknown=foo", "helloworld"},
|
"joined-val": {"--unknown=foo", "helloworld"},
|
||||||
} {
|
} {
|
||||||
args := args
|
|
||||||
t.Run(name, func(t *testing.T) {
|
t.Run(name, func(t *testing.T) {
|
||||||
res := icmd.RunCmd(run(args...))
|
res := icmd.RunCmd(run(args...))
|
||||||
res.Assert(t, icmd.Expected{
|
res.Assert(t, icmd.Expected{
|
||||||
|
|
|
@ -214,7 +214,6 @@ func TestMountSubvolume(t *testing.T) {
|
||||||
{name: "subdirectory mount", cmd: "ls", subpath: "subdir", expectedOut: "hello.txt"},
|
{name: "subdirectory mount", cmd: "ls", subpath: "subdir", expectedOut: "hello.txt"},
|
||||||
{name: "file mount", cmd: "cat", subpath: "bar.txt", expectedOut: "foo"},
|
{name: "file mount", cmd: "cat", subpath: "bar.txt", expectedOut: "foo"},
|
||||||
} {
|
} {
|
||||||
tc := tc
|
|
||||||
t.Run(tc.name, func(t *testing.T) {
|
t.Run(tc.name, func(t *testing.T) {
|
||||||
runMount(tc.cmd, "volume-subpath="+tc.subpath).Assert(t, icmd.Expected{
|
runMount(tc.cmd, "volume-subpath="+tc.subpath).Assert(t, icmd.Expected{
|
||||||
Err: tc.expectedErr,
|
Err: tc.expectedErr,
|
||||||
|
|
|
@ -182,7 +182,6 @@ func TestPromptExitCode(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
tc := tc
|
|
||||||
t.Run("case="+tc.name, func(t *testing.T) {
|
t.Run("case="+tc.name, func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue