diff --git a/server/pruning_test.go b/server/pruning_test.go index 41fab48ec0f3..916f4e07dfba 100644 --- a/server/pruning_test.go +++ b/server/pruning_test.go @@ -41,8 +41,8 @@ func TestGetPruningOptionsFromFlags(t *testing.T) { } for _, tt := range tests { + tt := tt t.Run(tt.name, func(j *testing.T) { - tt := tt viper.Reset() tt.initParams() require.Equal(t, tt.expectedOptions, GetPruningOptionsFromFlags()) diff --git a/server/start_test.go b/server/start_test.go index a9ef4b88e1f1..c9c4f61ef640 100644 --- a/server/start_test.go +++ b/server/start_test.go @@ -86,9 +86,9 @@ func TestPruningOptions(t *testing.T) { } for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - tt := tt + tt := tt + t.Run(tt.name, func(t *testing.T) { viper.Reset() tt.paramInit()