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:
Sebastiaan van Stijn 2024-11-05 09:59:07 +01:00
parent 1448cecba1
commit 20de861134
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
2 changed files with 0 additions and 2 deletions

View File

@ -433,7 +433,6 @@ func TestConfigPath(t *testing.T) {
expectedErr: fmt.Sprintf("is outside of root config directory %q", "dummy"),
},
} {
tc := tc
t.Run(tc.name, func(t *testing.T) {
SetDir(tc.dir)
f, err := Path(tc.path...)

View File

@ -297,7 +297,6 @@ func TestConvertToHostname(t *testing.T) {
},
}
for _, tc := range tests {
tc := tc
t.Run(tc.input, func(t *testing.T) {
actual := ConvertToHostname(tc.input)
assert.Equal(t, actual, tc.expected)