From 20de861134b97cb16dfbfa01bc1a67444ff8964a Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 5 Nov 2024 09:59:07 +0100 Subject: [PATCH] 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 --- cli/config/config_test.go | 1 - cli/config/credentials/file_store_test.go | 1 - 2 files changed, 2 deletions(-) diff --git a/cli/config/config_test.go b/cli/config/config_test.go index 9e8c89238e..0d0edfa1e1 100644 --- a/cli/config/config_test.go +++ b/cli/config/config_test.go @@ -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...) diff --git a/cli/config/credentials/file_store_test.go b/cli/config/credentials/file_store_test.go index 466fa054a0..5cf7d585a5 100644 --- a/cli/config/credentials/file_store_test.go +++ b/cli/config/credentials/file_store_test.go @@ -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)