mirror of https://github.com/docker/cli.git
cli/config: 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
1448cecba1
commit
20de861134
|
@ -433,7 +433,6 @@ func TestConfigPath(t *testing.T) {
|
||||||
expectedErr: fmt.Sprintf("is outside of root config directory %q", "dummy"),
|
expectedErr: fmt.Sprintf("is outside of root config directory %q", "dummy"),
|
||||||
},
|
},
|
||||||
} {
|
} {
|
||||||
tc := tc
|
|
||||||
t.Run(tc.name, func(t *testing.T) {
|
t.Run(tc.name, func(t *testing.T) {
|
||||||
SetDir(tc.dir)
|
SetDir(tc.dir)
|
||||||
f, err := Path(tc.path...)
|
f, err := Path(tc.path...)
|
||||||
|
|
|
@ -297,7 +297,6 @@ func TestConvertToHostname(t *testing.T) {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
for _, tc := range tests {
|
for _, tc := range tests {
|
||||||
tc := tc
|
|
||||||
t.Run(tc.input, func(t *testing.T) {
|
t.Run(tc.input, func(t *testing.T) {
|
||||||
actual := ConvertToHostname(tc.input)
|
actual := ConvertToHostname(tc.input)
|
||||||
assert.Equal(t, actual, tc.expected)
|
assert.Equal(t, actual, tc.expected)
|
||||||
|
|
Loading…
Reference in New Issue