diff --git a/.golangci.yml b/.golangci.yml index 78387e63c..fe326df34 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -5,9 +5,9 @@ issues: linters: disable-all: true enable: + - copyloopvar - durationcheck - errcheck - - exportloopref - forcetypeassert - gofmt - gosimple @@ -18,10 +18,10 @@ linters: - paralleltest - predeclared - staticcheck - - tenv - unconvert - unparam - unused + - usetesting - govet run: diff --git a/compare/values_differ_test.go b/compare/values_differ_test.go index 35653f339..6a6988721 100644 --- a/compare/values_differ_test.go +++ b/compare/values_differ_test.go @@ -47,8 +47,6 @@ func TestValuesDiffer_CompareValues(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/compare/values_same_test.go b/compare/values_same_test.go index dde2ee6ea..e868ab0ea 100644 --- a/compare/values_same_test.go +++ b/compare/values_same_test.go @@ -49,8 +49,6 @@ func TestValuesSame_CompareValues(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/config/directory_test.go b/config/directory_test.go index 22225cc75..2418c40f4 100644 --- a/config/directory_test.go +++ b/config/directory_test.go @@ -39,8 +39,6 @@ func TestTestStepConfigFunc_Exec_Directory(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/config/file_test.go b/config/file_test.go index c5cd49ac3..db60cba6a 100644 --- a/config/file_test.go +++ b/config/file_test.go @@ -39,8 +39,6 @@ func TestTestStepConfigFunc_Exec_File(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/config/variable_test.go b/config/variable_test.go index cdec9b7f1..8cea766cc 100644 --- a/config/variable_test.go +++ b/config/variable_test.go @@ -273,8 +273,6 @@ func TestMarshalJSON(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() @@ -321,8 +319,6 @@ func TestVariablesWrite(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/helper/acctest/random_test.go b/helper/acctest/random_test.go index 85064780f..ebeab89e3 100644 --- a/helper/acctest/random_test.go +++ b/helper/acctest/random_test.go @@ -96,8 +96,6 @@ func TestRandSSHKeyPair(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() @@ -198,7 +196,6 @@ func TestInverseMask(t *testing.T) { } for tName, tCase := range testCases { - tName, tCase := tName, tCase t.Run(tName, func(t *testing.T) { t.Parallel() diff --git a/helper/resource/plugin_test.go b/helper/resource/plugin_test.go index ac8244185..e3b159963 100644 --- a/helper/resource/plugin_test.go +++ b/helper/resource/plugin_test.go @@ -79,8 +79,6 @@ func TestProtoV5ProviderFactoriesMerge(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() @@ -154,8 +152,6 @@ func TestProtoV6ProviderFactoriesMerge(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() @@ -229,8 +225,6 @@ func TestSdkProviderFactoriesMerge(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/helper/resource/testcase_providers_test.go b/helper/resource/testcase_providers_test.go index 45af1c784..4b54d725d 100644 --- a/helper/resource/testcase_providers_test.go +++ b/helper/resource/testcase_providers_test.go @@ -231,8 +231,6 @@ provider "test" {}`, } for name, test := range tests { - name, test := name, test - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/helper/resource/testcase_validate_test.go b/helper/resource/testcase_validate_test.go index a3aa09b59..7e79492be 100644 --- a/helper/resource/testcase_validate_test.go +++ b/helper/resource/testcase_validate_test.go @@ -36,8 +36,6 @@ func TestTestCaseHasExternalProviders(t *testing.T) { } for name, test := range tests { - name, test := name, test - t.Run(name, func(t *testing.T) { t.Parallel() @@ -104,8 +102,6 @@ func TestTestCaseHasProviders(t *testing.T) { } for name, test := range tests { - name, test := name, test - t.Run(name, func(t *testing.T) { t.Parallel() @@ -184,8 +180,6 @@ func TestTestCaseValidate(t *testing.T) { } for name, test := range tests { - name, test := name, test - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/helper/resource/testing_new_test.go b/helper/resource/testing_new_test.go index c285c1b13..22f726261 100644 --- a/helper/resource/testing_new_test.go +++ b/helper/resource/testing_new_test.go @@ -1125,8 +1125,6 @@ func TestShimState(t *testing.T) { } for i, tc := range testCases { - i, tc := i, tc - t.Run(fmt.Sprintf("%d-%s", i, tc.Name), func(t *testing.T) { t.Parallel() diff --git a/helper/resource/testing_sets_test.go b/helper/resource/testing_sets_test.go index 0805a90b5..4d50e7ecc 100644 --- a/helper/resource/testing_sets_test.go +++ b/helper/resource/testing_sets_test.go @@ -402,7 +402,6 @@ func TestTestCheckTypeSetElemAttr(t *testing.T) { } for _, testCase := range testCases { - testCase := testCase t.Run(testCase.Description, func(t *testing.T) { t.Parallel() @@ -1010,7 +1009,6 @@ func TestTestCheckTypeSetElemAttrPair(t *testing.T) { } for _, testCase := range testCases { - testCase := testCase t.Run(testCase.Description, func(t *testing.T) { t.Parallel() @@ -1754,7 +1752,6 @@ func TestTestMatchTypeSetElemNestedAttrs(t *testing.T) { } for _, testCase := range testCases { - testCase := testCase t.Run(testCase.Description, func(t *testing.T) { t.Parallel() @@ -2593,7 +2590,6 @@ func TestTestCheckTypeSetElemNestedAttrs(t *testing.T) { } for _, testCase := range testCases { - testCase := testCase t.Run(testCase.Description, func(t *testing.T) { t.Parallel() diff --git a/helper/resource/testing_test.go b/helper/resource/testing_test.go index 00137efc9..cfd8afcff 100644 --- a/helper/resource/testing_test.go +++ b/helper/resource/testing_test.go @@ -177,7 +177,7 @@ func TestTest_Main(t *testing.T) { for _, tc := range cases { // reset sweepers sweeperFuncs = map[string]*Sweeper{} - tc := tc + t.Run(tc.Name, func(t *testing.T) { t.Parallel() @@ -389,7 +389,6 @@ func TestFilterSweepers(t *testing.T) { for _, tc := range cases { // reset sweepers sweeperFuncs = map[string]*Sweeper{} - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() @@ -634,7 +633,6 @@ func TestFilterSweeperWithDependencies(t *testing.T) { for _, tc := range cases { // reset sweepers sweeperFuncs = map[string]*Sweeper{} - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() @@ -813,7 +811,6 @@ func TestRunSweepers(t *testing.T) { for _, tc := range cases { // reset sweepers sweeperFuncs = map[string]*Sweeper{} - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() @@ -1363,8 +1360,6 @@ func TestTestCheckResourceAttr(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() @@ -1778,8 +1773,6 @@ func TestTestCheckResourceAttrWith(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() @@ -2000,8 +1993,6 @@ func TestTestCheckNoResourceAttr(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() @@ -2295,8 +2286,6 @@ func TestTestCheckResourceAttrPair(t *testing.T) { } for name, test := range tests { - name, test := name, test - t.Run(name, func(t *testing.T) { t.Parallel() @@ -2431,8 +2420,6 @@ func TestTestCheckResourceAttrSet(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/helper/resource/teststep_providers_test.go b/helper/resource/teststep_providers_test.go index e4d1fd7fb..68a5c4621 100644 --- a/helper/resource/teststep_providers_test.go +++ b/helper/resource/teststep_providers_test.go @@ -657,8 +657,6 @@ resource "test_test" "test" {} } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() @@ -1382,8 +1380,6 @@ resource "test_test" "test" {} } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() @@ -1601,8 +1597,6 @@ provider "test" {} } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() @@ -1856,8 +1850,6 @@ terraform { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/helper/resource/teststep_validate_test.go b/helper/resource/teststep_validate_test.go index a4e955b39..e040726d5 100644 --- a/helper/resource/teststep_validate_test.go +++ b/helper/resource/teststep_validate_test.go @@ -43,8 +43,6 @@ func TestTestStepHasExternalProviders(t *testing.T) { } for name, test := range tests { - name, test := name, test - t.Run(name, func(t *testing.T) { t.Parallel() @@ -105,8 +103,6 @@ func TestTestStepHasProviders(t *testing.T) { var stepIndex int for name, test := range tests { - name, test := name, test - t.Run(name, func(t *testing.T) { t.Parallel() @@ -510,8 +506,6 @@ func TestTestStepValidate(t *testing.T) { } for name, test := range tests { - name, test := name, test - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/helper/resource/tfversion_checks_test.go b/helper/resource/tfversion_checks_test.go index 0bc2238f4..6410bc732 100644 --- a/helper/resource/tfversion_checks_test.go +++ b/helper/resource/tfversion_checks_test.go @@ -48,8 +48,6 @@ func TestRunTFVersionChecks(t *testing.T) { } for name, test := range tests { - name, test := name, test - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/internal/configs/configschema/coerce_value_test.go b/internal/configs/configschema/coerce_value_test.go index 9363e7075..30ea60e04 100644 --- a/internal/configs/configschema/coerce_value_test.go +++ b/internal/configs/configschema/coerce_value_test.go @@ -546,8 +546,6 @@ func TestCoerceValue(t *testing.T) { } for name, test := range tests { - name, test := name, test - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/internal/configs/configschema/empty_value_test.go b/internal/configs/configschema/empty_value_test.go index 6b7d758da..cd7642568 100644 --- a/internal/configs/configschema/empty_value_test.go +++ b/internal/configs/configschema/empty_value_test.go @@ -163,7 +163,6 @@ func TestBlockEmptyValue(t *testing.T) { } for _, test := range tests { - test := test t.Run(fmt.Sprintf("%#v", test.Schema), func(t *testing.T) { t.Parallel() diff --git a/internal/configs/configschema/implied_type_test.go b/internal/configs/configschema/implied_type_test.go index 5da233a91..1faf25252 100644 --- a/internal/configs/configschema/implied_type_test.go +++ b/internal/configs/configschema/implied_type_test.go @@ -119,8 +119,6 @@ func TestBlockImpliedType(t *testing.T) { } for name, test := range tests { - name, test := name, test - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/internal/configs/hcl2shim/flatmap_test.go b/internal/configs/hcl2shim/flatmap_test.go index 410887fa2..3eb5fead2 100644 --- a/internal/configs/hcl2shim/flatmap_test.go +++ b/internal/configs/hcl2shim/flatmap_test.go @@ -243,7 +243,6 @@ func TestFlatmapValueFromHCL2(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.Value.GoString(), func(t *testing.T) { t.Parallel() @@ -312,7 +311,6 @@ func TestFlatmapValueFromHCL2FromFlatmap(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.Name, func(t *testing.T) { t.Parallel() @@ -740,8 +738,6 @@ func TestHCL2ValueFromFlatmap(t *testing.T) { } for i, test := range tests { - i, test := i, test - t.Run(fmt.Sprintf("%d %#v as %#v", i, test.Flatmap, test.Type), func(t *testing.T) { t.Parallel() diff --git a/internal/configs/hcl2shim/paths_test.go b/internal/configs/hcl2shim/paths_test.go index 82ce4b68f..1b5c38373 100644 --- a/internal/configs/hcl2shim/paths_test.go +++ b/internal/configs/hcl2shim/paths_test.go @@ -211,7 +211,6 @@ func TestPathFromFlatmap(t *testing.T) { } for _, test := range tests { - test := test t.Run(fmt.Sprintf("%s as %#v", test.Flatmap, test.Type), func(t *testing.T) { t.Parallel() @@ -364,7 +363,6 @@ func TestRequiresReplace(t *testing.T) { }, }, } { - tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() @@ -413,8 +411,6 @@ func TestFlatmapKeyFromPath(t *testing.T) { attr: "attr.key.obj_attr.0.force_new", }, } { - i, tc := i, tc - t.Run(strconv.Itoa(i), func(t *testing.T) { t.Parallel() diff --git a/internal/configs/hcl2shim/values_equiv_test.go b/internal/configs/hcl2shim/values_equiv_test.go index bfbb41ec1..35b40fe45 100644 --- a/internal/configs/hcl2shim/values_equiv_test.go +++ b/internal/configs/hcl2shim/values_equiv_test.go @@ -419,7 +419,6 @@ func TestValuesSDKEquivalent(t *testing.T) { } for _, test := range tests { - test := test t.Run(fmt.Sprintf("%#v ≈ %#v", test.A, test.B), func(t *testing.T) { t.Parallel() diff --git a/internal/configs/hcl2shim/values_test.go b/internal/configs/hcl2shim/values_test.go index e063bbed9..f14d76882 100644 --- a/internal/configs/hcl2shim/values_test.go +++ b/internal/configs/hcl2shim/values_test.go @@ -241,7 +241,6 @@ func TestConfigValueFromHCL2Block(t *testing.T) { } for _, test := range tests { - test := test t.Run(fmt.Sprintf("%#v", test.Input), func(t *testing.T) { t.Parallel() @@ -334,7 +333,6 @@ func TestConfigValueFromHCL2(t *testing.T) { } for _, test := range tests { - test := test t.Run(fmt.Sprintf("%#v", test.Input), func(t *testing.T) { t.Parallel() @@ -423,7 +421,6 @@ func TestHCL2ValueFromConfigValue(t *testing.T) { } for _, test := range tests { - test := test t.Run(fmt.Sprintf("%#v", test.Input), func(t *testing.T) { t.Parallel() diff --git a/internal/teststep/config_test.go b/internal/teststep/config_test.go index 5a5415cb7..7f7061b72 100644 --- a/internal/teststep/config_test.go +++ b/internal/teststep/config_test.go @@ -136,8 +136,6 @@ func TestPrepareConfigurationRequest_Exec(t *testing.T) { }) for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() @@ -198,8 +196,6 @@ func TestConfigurationRequest_Validate(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() @@ -262,8 +258,6 @@ func TestConfiguration(t *testing.T) { ) for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/internal/teststep/directory_test.go b/internal/teststep/directory_test.go index dfea5c663..0118b91d5 100644 --- a/internal/teststep/directory_test.go +++ b/internal/teststep/directory_test.go @@ -102,8 +102,6 @@ func TestConfigurationDirectory_HasProviderBlock(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() @@ -219,8 +217,6 @@ func TestConfigurationDirectory_HasProviderBlock_AbsolutePath(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() @@ -308,8 +304,6 @@ func TestConfigurationDirectory_HasTerraformBlock(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() @@ -389,8 +383,6 @@ func TestConfigurationDirectory_HasTerraformBlock_AbsolutePath(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() @@ -456,8 +448,6 @@ func TestConfigurationDirectory_Write(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() @@ -549,8 +539,6 @@ func TestConfigurationDirectory_Write_AbsolutePath(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/internal/teststep/file_test.go b/internal/teststep/file_test.go index 4854c2be9..5d0ebb73f 100644 --- a/internal/teststep/file_test.go +++ b/internal/teststep/file_test.go @@ -102,8 +102,6 @@ func TestConfigurationFile_HasProviderBlock(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() @@ -219,8 +217,6 @@ func TestConfigurationFile_HasProviderBlock_AbsolutePath(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() @@ -308,8 +304,6 @@ func TestConfigurationFile_HasTerraformBlock(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() @@ -389,8 +383,6 @@ func TestConfigurationFile_HasTerraformBlock_AbsolutePath(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() @@ -446,8 +438,6 @@ func TestConfigurationFile_Write(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() @@ -511,8 +501,6 @@ func TestConfigurationFile_Write_AbsolutePath(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/internal/teststep/string_test.go b/internal/teststep/string_test.go index cb9fdecdd..a55501efc 100644 --- a/internal/teststep/string_test.go +++ b/internal/teststep/string_test.go @@ -149,8 +149,6 @@ resource "test_test" "test" {} } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() @@ -240,8 +238,6 @@ resource "test_test" "test" {} } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() @@ -278,8 +274,6 @@ resource "test_test" "test" {} } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/knownvalue/bool_test.go b/knownvalue/bool_test.go index 35ba1d40e..aa962fec8 100644 --- a/knownvalue/bool_test.go +++ b/knownvalue/bool_test.go @@ -49,8 +49,6 @@ func TestBoolValue_CheckValue(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/knownvalue/float32_test.go b/knownvalue/float32_test.go index 4b2ef14c4..ecab29c0d 100644 --- a/knownvalue/float32_test.go +++ b/knownvalue/float32_test.go @@ -50,8 +50,6 @@ func TestFloat32Value_CheckValue(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/knownvalue/float64_test.go b/knownvalue/float64_test.go index 2a051f8b2..26b2cf309 100644 --- a/knownvalue/float64_test.go +++ b/knownvalue/float64_test.go @@ -50,8 +50,6 @@ func TestFloat64Value_CheckValue(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/knownvalue/int32_test.go b/knownvalue/int32_test.go index b153dee29..158724ca0 100644 --- a/knownvalue/int32_test.go +++ b/knownvalue/int32_test.go @@ -50,8 +50,6 @@ func TestInt32Value_CheckValue(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/knownvalue/int64_test.go b/knownvalue/int64_test.go index f367f33a0..2f7cd7c50 100644 --- a/knownvalue/int64_test.go +++ b/knownvalue/int64_test.go @@ -50,8 +50,6 @@ func TestInt64Value_CheckValue(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/knownvalue/list_partial_test.go b/knownvalue/list_partial_test.go index 31cb6163c..eafb8d2e1 100644 --- a/knownvalue/list_partial_test.go +++ b/knownvalue/list_partial_test.go @@ -111,8 +111,6 @@ func TestListValuePartial_CheckValue(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/knownvalue/list_size_test.go b/knownvalue/list_size_test.go index 1ca2fd547..89e97d9d4 100644 --- a/knownvalue/list_size_test.go +++ b/knownvalue/list_size_test.go @@ -61,8 +61,6 @@ func TestListElements_CheckValue(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/knownvalue/list_test.go b/knownvalue/list_test.go index 8b11f1c96..6b6b700d2 100644 --- a/knownvalue/list_test.go +++ b/knownvalue/list_test.go @@ -108,8 +108,6 @@ func TestListValue_CheckValue(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/knownvalue/map_partial_test.go b/knownvalue/map_partial_test.go index 30bceae11..1cc3c2897 100644 --- a/knownvalue/map_partial_test.go +++ b/knownvalue/map_partial_test.go @@ -114,8 +114,6 @@ func TestMapValuePartial_CheckValue(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/knownvalue/map_size_test.go b/knownvalue/map_size_test.go index 9cf171738..d90814017 100644 --- a/knownvalue/map_size_test.go +++ b/knownvalue/map_size_test.go @@ -61,8 +61,6 @@ func TestMapElements_CheckValue(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/knownvalue/map_test.go b/knownvalue/map_test.go index 09e6736b5..59ff34458 100644 --- a/knownvalue/map_test.go +++ b/knownvalue/map_test.go @@ -121,8 +121,6 @@ func TestMapValue_CheckValue(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/knownvalue/not_null_test.go b/knownvalue/not_null_test.go index 908c4b769..4ed3e44d5 100644 --- a/knownvalue/not_null_test.go +++ b/knownvalue/not_null_test.go @@ -36,8 +36,6 @@ func TestNotNullValue_CheckValue(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/knownvalue/null_test.go b/knownvalue/null_test.go index a9cc33d97..d6cb27a2d 100644 --- a/knownvalue/null_test.go +++ b/knownvalue/null_test.go @@ -35,8 +35,6 @@ func TestNullValue_CheckValue(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/knownvalue/number_test.go b/knownvalue/number_test.go index 50f6e12d5..26446f50e 100644 --- a/knownvalue/number_test.go +++ b/knownvalue/number_test.go @@ -58,8 +58,6 @@ func TestNumberValue_Equal(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/knownvalue/object_partial_test.go b/knownvalue/object_partial_test.go index 20884d0e4..7fae38086 100644 --- a/knownvalue/object_partial_test.go +++ b/knownvalue/object_partial_test.go @@ -114,8 +114,6 @@ func TestObjectValuePartial_CheckValue(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/knownvalue/object_test.go b/knownvalue/object_test.go index 07693fbff..0c3d0be64 100644 --- a/knownvalue/object_test.go +++ b/knownvalue/object_test.go @@ -121,8 +121,6 @@ func TestObjectValue_CheckValue(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/knownvalue/set_partial_test.go b/knownvalue/set_partial_test.go index b58baff50..b936c4c97 100644 --- a/knownvalue/set_partial_test.go +++ b/knownvalue/set_partial_test.go @@ -98,8 +98,6 @@ func TestSetValuePartial_CheckValue(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/knownvalue/set_size_test.go b/knownvalue/set_size_test.go index aed263be6..b45dcdf32 100644 --- a/knownvalue/set_size_test.go +++ b/knownvalue/set_size_test.go @@ -61,8 +61,6 @@ func TestSetElements_CheckValue(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/knownvalue/set_test.go b/knownvalue/set_test.go index dad5cd849..125cd19cf 100644 --- a/knownvalue/set_test.go +++ b/knownvalue/set_test.go @@ -107,8 +107,6 @@ func TestSetValue_CheckValue(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/knownvalue/string_regexp_test.go b/knownvalue/string_regexp_test.go index 172a72286..86d5d4834 100644 --- a/knownvalue/string_regexp_test.go +++ b/knownvalue/string_regexp_test.go @@ -50,8 +50,6 @@ func TestStringRegexp_CheckValue(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/knownvalue/string_test.go b/knownvalue/string_test.go index 7d7a8da3a..2bab25739 100644 --- a/knownvalue/string_test.go +++ b/knownvalue/string_test.go @@ -49,8 +49,6 @@ func TestStringValue_CheckValue(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/knownvalue/tuple_partial_test.go b/knownvalue/tuple_partial_test.go index 4935c9f3e..56eb34e19 100644 --- a/knownvalue/tuple_partial_test.go +++ b/knownvalue/tuple_partial_test.go @@ -109,8 +109,6 @@ func TestTuplePartial_CheckValue(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/knownvalue/tuple_size_test.go b/knownvalue/tuple_size_test.go index 7e8388bd2..bd5954f2f 100644 --- a/knownvalue/tuple_size_test.go +++ b/knownvalue/tuple_size_test.go @@ -62,8 +62,6 @@ func TestTupleSizeExact_CheckValue(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/knownvalue/tuple_test.go b/knownvalue/tuple_test.go index f1dfdd605..f5a82d76c 100644 --- a/knownvalue/tuple_test.go +++ b/knownvalue/tuple_test.go @@ -108,8 +108,6 @@ func TestTupleExact_CheckValue(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/plancheck/expect_known_output_value_at_path_test.go b/plancheck/expect_known_output_value_at_path_test.go index a6eca3356..0d61e57dd 100644 --- a/plancheck/expect_known_output_value_at_path_test.go +++ b/plancheck/expect_known_output_value_at_path_test.go @@ -1947,8 +1947,6 @@ func TestExpectKnownOutputValueAtPath_CheckPlan_UnknownAttributeType(t *testing. } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/plancheck/expect_known_output_value_test.go b/plancheck/expect_known_output_value_test.go index 504c30c8f..2065e20ba 100644 --- a/plancheck/expect_known_output_value_test.go +++ b/plancheck/expect_known_output_value_test.go @@ -1647,8 +1647,6 @@ func TestExpectKnownOutputValue_CheckPlan_UnknownAttributeType(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/plancheck/expect_known_value_test.go b/plancheck/expect_known_value_test.go index 63a68d7e9..5256892a9 100644 --- a/plancheck/expect_known_value_test.go +++ b/plancheck/expect_known_value_test.go @@ -1498,8 +1498,6 @@ func TestExpectKnownValue_CheckPlan_UnknownAttributeType(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/statecheck/expect_known_output_value_at_path_test.go b/statecheck/expect_known_output_value_at_path_test.go index 0b6013bcd..34e0bfe0b 100644 --- a/statecheck/expect_known_output_value_at_path_test.go +++ b/statecheck/expect_known_output_value_at_path_test.go @@ -1611,8 +1611,6 @@ func TestExpectKnownOutputValueAtPath_CheckState_UnknownAttributeType(t *testing } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/statecheck/expect_known_output_value_test.go b/statecheck/expect_known_output_value_test.go index 62d9067fe..69c63dc1d 100644 --- a/statecheck/expect_known_output_value_test.go +++ b/statecheck/expect_known_output_value_test.go @@ -1545,8 +1545,6 @@ func TestExpectKnownOutputValue_CheckState_UnknownAttributeType(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/statecheck/expect_known_value_test.go b/statecheck/expect_known_value_test.go index 2eb56d4e4..18cc07901 100644 --- a/statecheck/expect_known_value_test.go +++ b/statecheck/expect_known_value_test.go @@ -1515,8 +1515,6 @@ func TestExpectKnownValue_CheckState_UnknownAttributeType(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/terraform/diff_test.go b/terraform/diff_test.go index df75bedc2..325b208f6 100644 --- a/terraform/diff_test.go +++ b/terraform/diff_test.go @@ -820,8 +820,6 @@ func TestInstanceDiffSame(t *testing.T) { } for i, tc := range cases { - i, tc := i, tc - t.Run(fmt.Sprintf("%d", i), func(t *testing.T) { t.Parallel() @@ -867,8 +865,6 @@ func TestCountFlatmapContainerValues(t *testing.T) { count: "2", }, } { - i, tc := i, tc - t.Run(strconv.Itoa(i), func(t *testing.T) { t.Parallel() diff --git a/terraform/resource_address_test.go b/terraform/resource_address_test.go index 6cbacc257..285c2fb33 100644 --- a/terraform/resource_address_test.go +++ b/terraform/resource_address_test.go @@ -189,8 +189,6 @@ func TestParseResourceAddress(t *testing.T) { } for tn, tc := range cases { - tn, tc := tn, tc - t.Run(tn, func(t *testing.T) { t.Parallel() @@ -288,7 +286,6 @@ func TestResourceAddressLess(t *testing.T) { } for _, test := range tests { - test := test t.Run(fmt.Sprintf("%s < %s", test.A, test.B), func(t *testing.T) { t.Parallel() diff --git a/terraform/resource_test.go b/terraform/resource_test.go index 9f871351a..baccc4254 100644 --- a/terraform/resource_test.go +++ b/terraform/resource_test.go @@ -185,8 +185,6 @@ func TestResourceConfigGet(t *testing.T) { } for i, tc := range cases { - i, tc := i, tc - rc := NewResourceConfigShimmed(tc.Config, tc.Schema) // Test getting a key @@ -636,7 +634,6 @@ func TestNewResourceConfigShimmed(t *testing.T) { }, }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() diff --git a/terraform/state_test.go b/terraform/state_test.go index a7a233cc9..41c536856 100644 --- a/terraform/state_test.go +++ b/terraform/state_test.go @@ -183,8 +183,6 @@ func TestStateDeepCopy(t *testing.T) { } for i, tc := range cases { - i, tc := i, tc - t.Run(fmt.Sprintf("copy-%d", i), func(t *testing.T) { t.Parallel() @@ -389,8 +387,6 @@ func TestStateEqual(t *testing.T) { } for i, tc := range cases { - i, tc := i, tc - t.Run(fmt.Sprintf("%d-%s", i, tc.Name), func(t *testing.T) { t.Parallel() diff --git a/terraform/unknown_value_walk_test.go b/terraform/unknown_value_walk_test.go index 581849ea4..775c76b48 100644 --- a/terraform/unknown_value_walk_test.go +++ b/terraform/unknown_value_walk_test.go @@ -56,8 +56,6 @@ func TestUnknownValueWalk(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase - t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/terraform/util_test.go b/terraform/util_test.go index 0c68f9e67..461cea234 100644 --- a/terraform/util_test.go +++ b/terraform/util_test.go @@ -43,8 +43,6 @@ func TestUniqueStrings(t *testing.T) { } for i, tc := range cases { - i, tc := i, tc - t.Run(fmt.Sprintf("unique-%d", i), func(t *testing.T) { t.Parallel() diff --git a/tfjsonpath/path_test.go b/tfjsonpath/path_test.go index 83c13061c..878def1fa 100644 --- a/tfjsonpath/path_test.go +++ b/tfjsonpath/path_test.go @@ -472,8 +472,6 @@ func Test_Traverse_Array_ExpectError(t *testing.T) { } for name, tc := range testCases { - name, tc := name, tc - t.Run(name, func(t *testing.T) { t.Parallel() @@ -516,8 +514,6 @@ func TestPath_String(t *testing.T) { } for name, tc := range testCases { - name, tc := name, tc - t.Run(name, func(t *testing.T) { t.Parallel()