From fdff2dec79c30d45af9d3330907f40ebb75b53d4 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Sun, 19 May 2024 16:02:16 +1000 Subject: Remove redundant variable dedeclarations In go 1.22, loop variables are redeclared with each iteration of the loop, rather than simple updated on each iteration. This means that we no longer need to manually redeclare variables when they're closed over by a function. --- pkg/commands/git_commands/stash_test.go | 3 --- 1 file changed, 3 deletions(-) (limited to 'pkg/commands/git_commands/stash_test.go') diff --git a/pkg/commands/git_commands/stash_test.go b/pkg/commands/git_commands/stash_test.go index 35b48e42d..accd05890 100644 --- a/pkg/commands/git_commands/stash_test.go +++ b/pkg/commands/git_commands/stash_test.go @@ -74,7 +74,6 @@ func TestStashStore(t *testing.T) { } for _, s := range scenarios { - s := s t.Run(s.testName, func(t *testing.T) { runner := oscommands.NewFakeRunner(t). ExpectGitArgs(s.expected, "", nil) @@ -131,7 +130,6 @@ func TestStashStashEntryCmdObj(t *testing.T) { } for _, s := range scenarios { - s := s t.Run(s.testName, func(t *testing.T) { userConfig := config.GetDefaultConfig() appState := &config.AppState{} @@ -181,7 +179,6 @@ func TestStashRename(t *testing.T) { } for _, s := range scenarios { - s := s t.Run(s.testName, func(t *testing.T) { runner := oscommands.NewFakeRunner(t). ExpectGitArgs(s.expectedHashCmd, s.hashResult, nil). -- cgit v1.2.3