diff --git a/.golangci.yml b/.golangci.yml index f8175fa9..b2c03a23 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -7,7 +7,7 @@ linters: enable: - durationcheck - errcheck - - exportloopref + - copyloopvar - forcetypeassert - gofmt - gosimple @@ -18,7 +18,7 @@ linters: - paralleltest - predeclared - staticcheck - - tenv + - usetesting - unconvert - unparam - unused diff --git a/boolvalidator/equals_test.go b/boolvalidator/equals_test.go index ed2671e1..1798fbd5 100644 --- a/boolvalidator/equals_test.go +++ b/boolvalidator/equals_test.go @@ -8,10 +8,11 @@ import ( "fmt" "testing" - "github.com/hashicorp/terraform-plugin-framework-validators/boolvalidator" "github.com/hashicorp/terraform-plugin-framework/function" "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/types" + + "github.com/hashicorp/terraform-plugin-framework-validators/boolvalidator" ) func TestEqualsValidator(t *testing.T) { @@ -44,7 +45,6 @@ func TestEqualsValidator(t *testing.T) { } for name, test := range testCases { - name, test := name, test t.Run(fmt.Sprintf("ValidateBool - %s", name), func(t *testing.T) { t.Parallel() diff --git a/datasourcevalidator/all_test.go b/datasourcevalidator/all_test.go index 95e3d171..439848d1 100644 --- a/datasourcevalidator/all_test.go +++ b/datasourcevalidator/all_test.go @@ -161,7 +161,6 @@ func TestAllValidatorValidateDataSource(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/datasourcevalidator/any_test.go b/datasourcevalidator/any_test.go index aeb607a8..1b801403 100644 --- a/datasourcevalidator/any_test.go +++ b/datasourcevalidator/any_test.go @@ -138,7 +138,6 @@ func TestAnyValidatorValidateDataSource(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/datasourcevalidator/any_with_all_warnings_test.go b/datasourcevalidator/any_with_all_warnings_test.go index e342aee4..5ec0bebe 100644 --- a/datasourcevalidator/any_with_all_warnings_test.go +++ b/datasourcevalidator/any_with_all_warnings_test.go @@ -199,7 +199,6 @@ func TestAnyWithAllWarningsValidatorValidateDataSource(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/datasourcevalidator/at_least_one_of_test.go b/datasourcevalidator/at_least_one_of_test.go index 1a7b1066..118676b2 100644 --- a/datasourcevalidator/at_least_one_of_test.go +++ b/datasourcevalidator/at_least_one_of_test.go @@ -8,13 +8,14 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/hashicorp/terraform-plugin-framework-validators/datasourcevalidator" "github.com/hashicorp/terraform-plugin-framework/datasource" "github.com/hashicorp/terraform-plugin-framework/datasource/schema" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-go/tftypes" + + "github.com/hashicorp/terraform-plugin-framework-validators/datasourcevalidator" ) func TestAtLeastOneOf(t *testing.T) { @@ -105,7 +106,6 @@ func TestAtLeastOneOf(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/datasourcevalidator/conflicting_test.go b/datasourcevalidator/conflicting_test.go index 53975b5e..a3e5dc5d 100644 --- a/datasourcevalidator/conflicting_test.go +++ b/datasourcevalidator/conflicting_test.go @@ -8,13 +8,14 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/hashicorp/terraform-plugin-framework-validators/datasourcevalidator" "github.com/hashicorp/terraform-plugin-framework/datasource" "github.com/hashicorp/terraform-plugin-framework/datasource/schema" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-go/tftypes" + + "github.com/hashicorp/terraform-plugin-framework-validators/datasourcevalidator" ) func TestConflicting(t *testing.T) { @@ -106,7 +107,6 @@ func TestConflicting(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/datasourcevalidator/exactly_one_of_test.go b/datasourcevalidator/exactly_one_of_test.go index 9c28a951..96f19ee1 100644 --- a/datasourcevalidator/exactly_one_of_test.go +++ b/datasourcevalidator/exactly_one_of_test.go @@ -8,13 +8,14 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/hashicorp/terraform-plugin-framework-validators/datasourcevalidator" "github.com/hashicorp/terraform-plugin-framework/datasource" "github.com/hashicorp/terraform-plugin-framework/datasource/schema" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-go/tftypes" + + "github.com/hashicorp/terraform-plugin-framework-validators/datasourcevalidator" ) func TestExactlyOneOf(t *testing.T) { @@ -106,7 +107,6 @@ func TestExactlyOneOf(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/datasourcevalidator/required_together_test.go b/datasourcevalidator/required_together_test.go index c36505fa..1186a2ee 100644 --- a/datasourcevalidator/required_together_test.go +++ b/datasourcevalidator/required_together_test.go @@ -8,13 +8,14 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/hashicorp/terraform-plugin-framework-validators/datasourcevalidator" "github.com/hashicorp/terraform-plugin-framework/datasource" "github.com/hashicorp/terraform-plugin-framework/datasource/schema" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-go/tftypes" + + "github.com/hashicorp/terraform-plugin-framework-validators/datasourcevalidator" ) func TestRequiredTogether(t *testing.T) { @@ -106,7 +107,6 @@ func TestRequiredTogether(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/ephemeralvalidator/all_test.go b/ephemeralvalidator/all_test.go index c8b158bf..bbfbc0a9 100644 --- a/ephemeralvalidator/all_test.go +++ b/ephemeralvalidator/all_test.go @@ -161,7 +161,6 @@ func TestAllValidatorValidateEphemeralResource(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/ephemeralvalidator/any_test.go b/ephemeralvalidator/any_test.go index aa990286..7d7b1e4d 100644 --- a/ephemeralvalidator/any_test.go +++ b/ephemeralvalidator/any_test.go @@ -138,7 +138,6 @@ func TestAnyValidatorValidateEphemeralResource(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/ephemeralvalidator/any_with_all_warnings_test.go b/ephemeralvalidator/any_with_all_warnings_test.go index c57c7547..d7ba93a8 100644 --- a/ephemeralvalidator/any_with_all_warnings_test.go +++ b/ephemeralvalidator/any_with_all_warnings_test.go @@ -199,7 +199,6 @@ func TestAnyWithAllWarningsValidatorValidateEphemeralResource(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/ephemeralvalidator/at_least_one_of_test.go b/ephemeralvalidator/at_least_one_of_test.go index 1c40aa7c..0f546d69 100644 --- a/ephemeralvalidator/at_least_one_of_test.go +++ b/ephemeralvalidator/at_least_one_of_test.go @@ -8,13 +8,14 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/hashicorp/terraform-plugin-framework-validators/ephemeralvalidator" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/ephemeral" "github.com/hashicorp/terraform-plugin-framework/ephemeral/schema" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-go/tftypes" + + "github.com/hashicorp/terraform-plugin-framework-validators/ephemeralvalidator" ) func TestAtLeastOneOf(t *testing.T) { @@ -105,7 +106,6 @@ func TestAtLeastOneOf(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/ephemeralvalidator/conflicting_test.go b/ephemeralvalidator/conflicting_test.go index b8044b18..864d5e14 100644 --- a/ephemeralvalidator/conflicting_test.go +++ b/ephemeralvalidator/conflicting_test.go @@ -8,13 +8,14 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/hashicorp/terraform-plugin-framework-validators/ephemeralvalidator" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/ephemeral" "github.com/hashicorp/terraform-plugin-framework/ephemeral/schema" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-go/tftypes" + + "github.com/hashicorp/terraform-plugin-framework-validators/ephemeralvalidator" ) func TestConflicting(t *testing.T) { @@ -106,7 +107,6 @@ func TestConflicting(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/ephemeralvalidator/exactly_one_of_test.go b/ephemeralvalidator/exactly_one_of_test.go index a205ec1f..d873ed2e 100644 --- a/ephemeralvalidator/exactly_one_of_test.go +++ b/ephemeralvalidator/exactly_one_of_test.go @@ -8,13 +8,14 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/hashicorp/terraform-plugin-framework-validators/ephemeralvalidator" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/ephemeral" "github.com/hashicorp/terraform-plugin-framework/ephemeral/schema" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-go/tftypes" + + "github.com/hashicorp/terraform-plugin-framework-validators/ephemeralvalidator" ) func TestExactlyOneOf(t *testing.T) { @@ -106,7 +107,6 @@ func TestExactlyOneOf(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/ephemeralvalidator/required_together_test.go b/ephemeralvalidator/required_together_test.go index 9dd514d2..8609f389 100644 --- a/ephemeralvalidator/required_together_test.go +++ b/ephemeralvalidator/required_together_test.go @@ -8,13 +8,14 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/hashicorp/terraform-plugin-framework-validators/ephemeralvalidator" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/ephemeral" "github.com/hashicorp/terraform-plugin-framework/ephemeral/schema" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-go/tftypes" + + "github.com/hashicorp/terraform-plugin-framework-validators/ephemeralvalidator" ) func TestRequiredTogether(t *testing.T) { @@ -106,7 +107,6 @@ func TestRequiredTogether(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/float32validator/all_test.go b/float32validator/all_test.go index f5f22cbe..6628eec6 100644 --- a/float32validator/all_test.go +++ b/float32validator/all_test.go @@ -55,7 +55,7 @@ func TestAllValidatorValidateFloat32(t *testing.T) { } for name, test := range tests { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() request := validator.Float32Request{ diff --git a/float32validator/any_test.go b/float32validator/any_test.go index 1b5b9a21..111e202d 100644 --- a/float32validator/any_test.go +++ b/float32validator/any_test.go @@ -66,7 +66,7 @@ func TestAnyValidatorValidateFloat32(t *testing.T) { } for name, test := range tests { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() request := validator.Float32Request{ diff --git a/float32validator/any_with_all_warnings_test.go b/float32validator/any_with_all_warnings_test.go index 4bacc5cb..596d4cba 100644 --- a/float32validator/any_with_all_warnings_test.go +++ b/float32validator/any_with_all_warnings_test.go @@ -67,7 +67,7 @@ func TestAnyWithAllWarningsValidatorValidateFloat32(t *testing.T) { } for name, test := range tests { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() request := validator.Float32Request{ diff --git a/float32validator/at_least_test.go b/float32validator/at_least_test.go index ea768381..3d9df1e4 100644 --- a/float32validator/at_least_test.go +++ b/float32validator/at_least_test.go @@ -53,7 +53,6 @@ func TestAtLeastValidator(t *testing.T) { } for name, test := range tests { - name, test := name, test t.Run(fmt.Sprintf("ValidateFloat32 - %s", name), func(t *testing.T) { t.Parallel() diff --git a/float32validator/at_most_test.go b/float32validator/at_most_test.go index b3915037..87c31599 100644 --- a/float32validator/at_most_test.go +++ b/float32validator/at_most_test.go @@ -53,7 +53,6 @@ func TestAtMostValidator(t *testing.T) { } for name, test := range tests { - name, test := name, test t.Run(fmt.Sprintf("ValidateFloat32 - %s", name), func(t *testing.T) { t.Parallel() diff --git a/float32validator/between_test.go b/float32validator/between_test.go index be0c11d4..defc7994 100644 --- a/float32validator/between_test.go +++ b/float32validator/between_test.go @@ -77,7 +77,6 @@ func TestBetweenValidator(t *testing.T) { } for name, test := range tests { - name, test := name, test t.Run(fmt.Sprintf("ValidateFloat32 - %s", name), func(t *testing.T) { t.Parallel() diff --git a/float32validator/none_of_test.go b/float32validator/none_of_test.go index 8fb8a353..569ecad4 100644 --- a/float32validator/none_of_test.go +++ b/float32validator/none_of_test.go @@ -62,7 +62,6 @@ func TestNoneOfValidator(t *testing.T) { } for name, test := range testCases { - name, test := name, test t.Run(fmt.Sprintf("ValidateFloat32 - %s", name), func(t *testing.T) { t.Parallel() diff --git a/float32validator/one_of_test.go b/float32validator/one_of_test.go index e960a040..79a49489 100644 --- a/float32validator/one_of_test.go +++ b/float32validator/one_of_test.go @@ -62,7 +62,6 @@ func TestOneOfValidator(t *testing.T) { } for name, test := range testCases { - name, test := name, test t.Run(fmt.Sprintf("ValidateFloat32 - %s", name), func(t *testing.T) { t.Parallel() diff --git a/float64validator/all_test.go b/float64validator/all_test.go index 95d8fb2e..ba562374 100644 --- a/float64validator/all_test.go +++ b/float64validator/all_test.go @@ -55,7 +55,7 @@ func TestAllValidatorValidateFloat64(t *testing.T) { } for name, test := range tests { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() request := validator.Float64Request{ diff --git a/float64validator/any_test.go b/float64validator/any_test.go index 2e9a629e..b4e0745b 100644 --- a/float64validator/any_test.go +++ b/float64validator/any_test.go @@ -66,7 +66,7 @@ func TestAnyValidatorValidateFloat64(t *testing.T) { } for name, test := range tests { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() request := validator.Float64Request{ diff --git a/float64validator/any_with_all_warnings_test.go b/float64validator/any_with_all_warnings_test.go index ecb5ba70..0c9b0541 100644 --- a/float64validator/any_with_all_warnings_test.go +++ b/float64validator/any_with_all_warnings_test.go @@ -67,7 +67,7 @@ func TestAnyWithAllWarningsValidatorValidateFloat64(t *testing.T) { } for name, test := range tests { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() request := validator.Float64Request{ diff --git a/float64validator/at_least_test.go b/float64validator/at_least_test.go index d24df495..db59c56b 100644 --- a/float64validator/at_least_test.go +++ b/float64validator/at_least_test.go @@ -53,7 +53,6 @@ func TestAtLeastValidator(t *testing.T) { } for name, test := range tests { - name, test := name, test t.Run(fmt.Sprintf("ValidateFloat64 - %s", name), func(t *testing.T) { t.Parallel() diff --git a/float64validator/at_most_test.go b/float64validator/at_most_test.go index 464ef945..7bfb4daf 100644 --- a/float64validator/at_most_test.go +++ b/float64validator/at_most_test.go @@ -53,7 +53,6 @@ func TestAtMostValidator(t *testing.T) { } for name, test := range tests { - name, test := name, test t.Run(fmt.Sprintf("ValidateFloat64 - %s", name), func(t *testing.T) { t.Parallel() diff --git a/float64validator/between_test.go b/float64validator/between_test.go index d9dbd4bc..52517141 100644 --- a/float64validator/between_test.go +++ b/float64validator/between_test.go @@ -8,11 +8,12 @@ import ( "fmt" "testing" - "github.com/hashicorp/terraform-plugin-framework-validators/float64validator" "github.com/hashicorp/terraform-plugin-framework/function" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/types" + + "github.com/hashicorp/terraform-plugin-framework-validators/float64validator" ) func TestBetweenValidator(t *testing.T) { @@ -76,7 +77,6 @@ func TestBetweenValidator(t *testing.T) { } for name, test := range tests { - name, test := name, test t.Run(fmt.Sprintf("ValidateFloat64 - %s", name), func(t *testing.T) { t.Parallel() diff --git a/float64validator/none_of_test.go b/float64validator/none_of_test.go index 01ba012a..51419cfe 100644 --- a/float64validator/none_of_test.go +++ b/float64validator/none_of_test.go @@ -62,7 +62,6 @@ func TestNoneOfValidator(t *testing.T) { } for name, test := range testCases { - name, test := name, test t.Run(fmt.Sprintf("ValidateFloat64 - %s", name), func(t *testing.T) { t.Parallel() diff --git a/float64validator/one_of_test.go b/float64validator/one_of_test.go index 3fb6d391..01a0c85f 100644 --- a/float64validator/one_of_test.go +++ b/float64validator/one_of_test.go @@ -62,7 +62,6 @@ func TestOneOfValidator(t *testing.T) { } for name, test := range testCases { - name, test := name, test t.Run(fmt.Sprintf("ValidateFloat64 - %s", name), func(t *testing.T) { t.Parallel() diff --git a/helpers/validatordiag/diag_test.go b/helpers/validatordiag/diag_test.go index b50e8ce4..e80fcd0d 100644 --- a/helpers/validatordiag/diag_test.go +++ b/helpers/validatordiag/diag_test.go @@ -34,7 +34,7 @@ func TestCapitalize(t *testing.T) { } for name, test := range tests { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() got := capitalize(test.input) diff --git a/int32validator/all_test.go b/int32validator/all_test.go index ff1266e5..6fe0e881 100644 --- a/int32validator/all_test.go +++ b/int32validator/all_test.go @@ -55,7 +55,7 @@ func TestAllValidatorValidateInt32(t *testing.T) { } for name, test := range tests { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() request := validator.Int32Request{ diff --git a/int32validator/any_test.go b/int32validator/any_test.go index 3bce8de2..2906afbb 100644 --- a/int32validator/any_test.go +++ b/int32validator/any_test.go @@ -66,7 +66,7 @@ func TestAnyValidatorValidateInt32(t *testing.T) { } for name, test := range tests { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() request := validator.Int32Request{ diff --git a/int32validator/any_with_all_warnings_test.go b/int32validator/any_with_all_warnings_test.go index cc84c96f..1e4b95ad 100644 --- a/int32validator/any_with_all_warnings_test.go +++ b/int32validator/any_with_all_warnings_test.go @@ -67,7 +67,7 @@ func TestAnyWithAllWarningsValidatorValidateInt32(t *testing.T) { } for name, test := range tests { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() request := validator.Int32Request{ diff --git a/int32validator/at_least_sum_of_test.go b/int32validator/at_least_sum_of_test.go index 8126c96b..824b515b 100644 --- a/int32validator/at_least_sum_of_test.go +++ b/int32validator/at_least_sum_of_test.go @@ -147,7 +147,7 @@ func TestAtLeastSumOfValidator(t *testing.T) { } for name, test := range tests { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() request := validator.Int32Request{ diff --git a/int32validator/at_least_test.go b/int32validator/at_least_test.go index 9eeb036c..d96272a4 100644 --- a/int32validator/at_least_test.go +++ b/int32validator/at_least_test.go @@ -49,7 +49,6 @@ func TestAtLeastValidator(t *testing.T) { } for name, test := range tests { - name, test := name, test t.Run(fmt.Sprintf("ValidateInt32 - %s", name), func(t *testing.T) { t.Parallel() diff --git a/int32validator/at_most_sum_of_test.go b/int32validator/at_most_sum_of_test.go index da63c63a..de889324 100644 --- a/int32validator/at_most_sum_of_test.go +++ b/int32validator/at_most_sum_of_test.go @@ -147,7 +147,7 @@ func TestAtMostSumOfValidator(t *testing.T) { } for name, test := range tests { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() request := validator.Int32Request{ diff --git a/int32validator/at_most_test.go b/int32validator/at_most_test.go index c28a1186..f1c651c8 100644 --- a/int32validator/at_most_test.go +++ b/int32validator/at_most_test.go @@ -49,7 +49,6 @@ func TestAtMostValidator(t *testing.T) { } for name, test := range tests { - name, test := name, test t.Run(fmt.Sprintf("ValidateInt32 - %s", name), func(t *testing.T) { t.Parallel() diff --git a/int32validator/between_test.go b/int32validator/between_test.go index b67f45bf..1e6ebe1f 100644 --- a/int32validator/between_test.go +++ b/int32validator/between_test.go @@ -72,7 +72,6 @@ func TestBetweenValidator(t *testing.T) { } for name, test := range tests { - name, test := name, test t.Run(fmt.Sprintf("ValidateInt32 - %s", name), func(t *testing.T) { t.Parallel() diff --git a/int32validator/equal_to_product_of_test.go b/int32validator/equal_to_product_of_test.go index 5d6e060f..8f0e9511 100644 --- a/int32validator/equal_to_product_of_test.go +++ b/int32validator/equal_to_product_of_test.go @@ -147,7 +147,7 @@ func TestEqualToProductOfValidator(t *testing.T) { } for name, test := range tests { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() request := validator.Int32Request{ diff --git a/int32validator/equal_to_sum_of_test.go b/int32validator/equal_to_sum_of_test.go index 76a122c2..69484f63 100644 --- a/int32validator/equal_to_sum_of_test.go +++ b/int32validator/equal_to_sum_of_test.go @@ -148,7 +148,7 @@ func TestEqualToSumOfValidator(t *testing.T) { } for name, test := range tests { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() request := validator.Int32Request{ diff --git a/int32validator/none_of_test.go b/int32validator/none_of_test.go index 2ad66c07..29a6b7d0 100644 --- a/int32validator/none_of_test.go +++ b/int32validator/none_of_test.go @@ -62,7 +62,6 @@ func TestNoneOfValidator(t *testing.T) { } for name, test := range testCases { - name, test := name, test t.Run(fmt.Sprintf("ValidateInt32 - %s", name), func(t *testing.T) { t.Parallel() diff --git a/int32validator/one_of_test.go b/int32validator/one_of_test.go index f04444e3..16d7ce54 100644 --- a/int32validator/one_of_test.go +++ b/int32validator/one_of_test.go @@ -8,10 +8,11 @@ import ( "fmt" "testing" - "github.com/hashicorp/terraform-plugin-framework-validators/int32validator" "github.com/hashicorp/terraform-plugin-framework/function" "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/types" + + "github.com/hashicorp/terraform-plugin-framework-validators/int32validator" ) func TestOneOfValidator(t *testing.T) { @@ -61,7 +62,6 @@ func TestOneOfValidator(t *testing.T) { } for name, test := range testCases { - name, test := name, test t.Run(fmt.Sprintf("ValidateInt32 - %s", name), func(t *testing.T) { t.Parallel() diff --git a/int64validator/all_test.go b/int64validator/all_test.go index 55cf6bc7..f444377e 100644 --- a/int64validator/all_test.go +++ b/int64validator/all_test.go @@ -55,7 +55,7 @@ func TestAllValidatorValidateInt64(t *testing.T) { } for name, test := range tests { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() request := validator.Int64Request{ diff --git a/int64validator/any_test.go b/int64validator/any_test.go index f49d00db..25c64b7a 100644 --- a/int64validator/any_test.go +++ b/int64validator/any_test.go @@ -66,7 +66,7 @@ func TestAnyValidatorValidateInt64(t *testing.T) { } for name, test := range tests { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() request := validator.Int64Request{ diff --git a/int64validator/any_with_all_warnings_test.go b/int64validator/any_with_all_warnings_test.go index d27cb667..89969d04 100644 --- a/int64validator/any_with_all_warnings_test.go +++ b/int64validator/any_with_all_warnings_test.go @@ -67,7 +67,7 @@ func TestAnyWithAllWarningsValidatorValidateInt64(t *testing.T) { } for name, test := range tests { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() request := validator.Int64Request{ diff --git a/int64validator/at_least_sum_of_test.go b/int64validator/at_least_sum_of_test.go index 1ac80708..ce22de62 100644 --- a/int64validator/at_least_sum_of_test.go +++ b/int64validator/at_least_sum_of_test.go @@ -147,7 +147,7 @@ func TestAtLeastSumOfValidator(t *testing.T) { } for name, test := range tests { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() request := validator.Int64Request{ diff --git a/int64validator/at_least_test.go b/int64validator/at_least_test.go index d224a5dc..73250a4d 100644 --- a/int64validator/at_least_test.go +++ b/int64validator/at_least_test.go @@ -49,7 +49,6 @@ func TestAtLeastValidator(t *testing.T) { } for name, test := range tests { - name, test := name, test t.Run(fmt.Sprintf("ValidateInt64 - %s", name), func(t *testing.T) { t.Parallel() diff --git a/int64validator/at_most_sum_of_test.go b/int64validator/at_most_sum_of_test.go index d85d3051..5d10d2dd 100644 --- a/int64validator/at_most_sum_of_test.go +++ b/int64validator/at_most_sum_of_test.go @@ -147,7 +147,7 @@ func TestAtMostSumOfValidator(t *testing.T) { } for name, test := range tests { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() request := validator.Int64Request{ diff --git a/int64validator/at_most_test.go b/int64validator/at_most_test.go index a94908dc..11ebd08e 100644 --- a/int64validator/at_most_test.go +++ b/int64validator/at_most_test.go @@ -49,7 +49,6 @@ func TestAtMostValidator(t *testing.T) { } for name, test := range tests { - name, test := name, test t.Run(fmt.Sprintf("ValidateInt64 - %s", name), func(t *testing.T) { t.Parallel() diff --git a/int64validator/between_test.go b/int64validator/between_test.go index a7f428c8..ca68c79e 100644 --- a/int64validator/between_test.go +++ b/int64validator/between_test.go @@ -72,7 +72,6 @@ func TestBetweenValidator(t *testing.T) { } for name, test := range tests { - name, test := name, test t.Run(fmt.Sprintf("ValidateInt64 - %s", name), func(t *testing.T) { t.Parallel() diff --git a/int64validator/equal_to_product_of_test.go b/int64validator/equal_to_product_of_test.go index c5bcd643..321893d9 100644 --- a/int64validator/equal_to_product_of_test.go +++ b/int64validator/equal_to_product_of_test.go @@ -147,7 +147,7 @@ func TestEqualToProductOfValidator(t *testing.T) { } for name, test := range tests { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() request := validator.Int64Request{ diff --git a/int64validator/equal_to_sum_of_test.go b/int64validator/equal_to_sum_of_test.go index fb150b4f..ff34d481 100644 --- a/int64validator/equal_to_sum_of_test.go +++ b/int64validator/equal_to_sum_of_test.go @@ -148,7 +148,7 @@ func TestEqualToSumOfValidator(t *testing.T) { } for name, test := range tests { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() request := validator.Int64Request{ diff --git a/int64validator/none_of_test.go b/int64validator/none_of_test.go index 53726ba6..48bc0840 100644 --- a/int64validator/none_of_test.go +++ b/int64validator/none_of_test.go @@ -62,7 +62,6 @@ func TestNoneOfValidator(t *testing.T) { } for name, test := range testCases { - name, test := name, test t.Run(fmt.Sprintf("ValidateInt64 - %s", name), func(t *testing.T) { t.Parallel() diff --git a/int64validator/one_of_test.go b/int64validator/one_of_test.go index 37f23cc7..a93e6023 100644 --- a/int64validator/one_of_test.go +++ b/int64validator/one_of_test.go @@ -62,7 +62,6 @@ func TestOneOfValidator(t *testing.T) { } for name, test := range testCases { - name, test := name, test t.Run(fmt.Sprintf("ValidateInt64 - %s", name), func(t *testing.T) { t.Parallel() diff --git a/internal/configvalidator/at_least_one_of_test.go b/internal/configvalidator/at_least_one_of_test.go index 94eeb86f..276ebb5a 100644 --- a/internal/configvalidator/at_least_one_of_test.go +++ b/internal/configvalidator/at_least_one_of_test.go @@ -598,7 +598,6 @@ func TestAtLeastOneOfValidatorValidate(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() @@ -704,7 +703,6 @@ func TestAtLeastOneOfValidatorValidateDataSource(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() @@ -812,7 +810,6 @@ func TestAtLeastOneOfValidatorValidateProvider(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() @@ -920,7 +917,6 @@ func TestAtLeastOneOfValidatorValidateResource(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() @@ -1028,7 +1024,6 @@ func TestAtLeastOneOfValidatorValidateEphemeralResource(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/configvalidator/conflicting_test.go b/internal/configvalidator/conflicting_test.go index 1f513f27..20f973a9 100644 --- a/internal/configvalidator/conflicting_test.go +++ b/internal/configvalidator/conflicting_test.go @@ -602,7 +602,6 @@ func TestConflictingValidatorValidate(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() @@ -709,7 +708,6 @@ func TestConflictingValidatorValidateDataSource(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() @@ -818,7 +816,6 @@ func TestConflictingValidatorValidateProvider(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() @@ -927,7 +924,6 @@ func TestConflictingValidatorValidateResource(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() @@ -1036,7 +1032,6 @@ func TestConflictingValidatorValidateEphemeralResource(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/configvalidator/exactly_one_of_test.go b/internal/configvalidator/exactly_one_of_test.go index 805c2ed8..ae8f3de7 100644 --- a/internal/configvalidator/exactly_one_of_test.go +++ b/internal/configvalidator/exactly_one_of_test.go @@ -622,7 +622,6 @@ func TestExactlyOneOfValidatorValidate(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() @@ -729,7 +728,6 @@ func TestExactlyOneOfValidatorValidateDataSource(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() @@ -838,7 +836,6 @@ func TestExactlyOneOfValidatorValidateProvider(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() @@ -947,7 +944,6 @@ func TestExactlyOneOfValidatorValidateResource(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() @@ -1056,7 +1052,6 @@ func TestExactlyOneOfValidatorValidateEphemeralResource(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/configvalidator/required_together_test.go b/internal/configvalidator/required_together_test.go index fd7f04f7..595d83f9 100644 --- a/internal/configvalidator/required_together_test.go +++ b/internal/configvalidator/required_together_test.go @@ -590,7 +590,6 @@ func TestRequiredTogetherValidatorValidate(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() @@ -697,7 +696,6 @@ func TestRequiredTogetherValidatorValidateDataSource(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() @@ -806,7 +804,6 @@ func TestRequiredTogetherValidatorValidateProvider(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() @@ -915,7 +912,6 @@ func TestRequiredTogetherValidatorValidateResource(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() @@ -1024,7 +1020,6 @@ func TestRequiredTogetherValidatorValidateEphemeralResource(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/schemavalidator/also_requires_test.go b/internal/schemavalidator/also_requires_test.go index 3ea0d40b..a17ebfa6 100644 --- a/internal/schemavalidator/also_requires_test.go +++ b/internal/schemavalidator/also_requires_test.go @@ -265,7 +265,7 @@ func TestAlsoRequiresValidatorValidate(t *testing.T) { } for name, test := range testCases { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() res := &schemavalidator.AlsoRequiresValidatorResponse{} diff --git a/internal/schemavalidator/at_least_one_of_test.go b/internal/schemavalidator/at_least_one_of_test.go index ce2122cf..f1f26ebf 100644 --- a/internal/schemavalidator/at_least_one_of_test.go +++ b/internal/schemavalidator/at_least_one_of_test.go @@ -298,7 +298,7 @@ func TestAtLeastOneOfValidatorValidate(t *testing.T) { } for name, test := range testCases { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() res := &schemavalidator.AtLeastOneOfValidatorResponse{} diff --git a/internal/schemavalidator/conflicts_with_test.go b/internal/schemavalidator/conflicts_with_test.go index faa45a9c..d7c80f08 100644 --- a/internal/schemavalidator/conflicts_with_test.go +++ b/internal/schemavalidator/conflicts_with_test.go @@ -266,7 +266,7 @@ func TestConflictsWithValidatorValidate(t *testing.T) { } for name, test := range testCases { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() res := &schemavalidator.ConflictsWithValidatorResponse{} diff --git a/internal/schemavalidator/exactly_one_of_test.go b/internal/schemavalidator/exactly_one_of_test.go index cb6dd1b2..1abe55f0 100644 --- a/internal/schemavalidator/exactly_one_of_test.go +++ b/internal/schemavalidator/exactly_one_of_test.go @@ -267,7 +267,7 @@ func TestExactlyOneOfValidator(t *testing.T) { } for name, test := range testCases { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() res := &schemavalidator.ExactlyOneOfValidatorResponse{} diff --git a/listvalidator/all_test.go b/listvalidator/all_test.go index 56ce1ded..4615337f 100644 --- a/listvalidator/all_test.go +++ b/listvalidator/all_test.go @@ -68,7 +68,7 @@ func TestAllValidatorValidateList(t *testing.T) { } for name, test := range tests { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() request := validator.ListRequest{ diff --git a/listvalidator/any_test.go b/listvalidator/any_test.go index 40bebfe4..76cf25b9 100644 --- a/listvalidator/any_test.go +++ b/listvalidator/any_test.go @@ -85,7 +85,7 @@ func TestAnyValidatorValidateList(t *testing.T) { } for name, test := range tests { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() request := validator.ListRequest{ diff --git a/listvalidator/any_with_all_warnings_test.go b/listvalidator/any_with_all_warnings_test.go index 659530d0..0cbf0855 100644 --- a/listvalidator/any_with_all_warnings_test.go +++ b/listvalidator/any_with_all_warnings_test.go @@ -86,7 +86,7 @@ func TestAnyWithAllWarningsValidatorValidateList(t *testing.T) { } for name, test := range tests { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() request := validator.ListRequest{ diff --git a/listvalidator/is_required_test.go b/listvalidator/is_required_test.go index 7bde543f..581377d4 100644 --- a/listvalidator/is_required_test.go +++ b/listvalidator/is_required_test.go @@ -7,11 +7,12 @@ import ( "context" "testing" - "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/types" + + "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" ) func TestIsRequiredValidator(t *testing.T) { @@ -53,7 +54,7 @@ func TestIsRequiredValidator(t *testing.T) { } for name, test := range tests { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() request := validator.ListRequest{ diff --git a/listvalidator/size_at_least_test.go b/listvalidator/size_at_least_test.go index ffb17606..c5a0a0f3 100644 --- a/listvalidator/size_at_least_test.go +++ b/listvalidator/size_at_least_test.go @@ -68,7 +68,6 @@ func TestSizeAtLeastValidator(t *testing.T) { } for name, test := range tests { - name, test := name, test t.Run(fmt.Sprintf("ValidateList - %s", name), func(t *testing.T) { t.Parallel() diff --git a/listvalidator/size_at_most_test.go b/listvalidator/size_at_most_test.go index a8cad9ac..83b2d9dc 100644 --- a/listvalidator/size_at_most_test.go +++ b/listvalidator/size_at_most_test.go @@ -72,7 +72,6 @@ func TestSizeAtMostValidator(t *testing.T) { } for name, test := range tests { - name, test := name, test t.Run(fmt.Sprintf("ValidateList - %s", name), func(t *testing.T) { t.Parallel() diff --git a/listvalidator/size_between_test.go b/listvalidator/size_between_test.go index 1b35c9d8..6902c9c2 100644 --- a/listvalidator/size_between_test.go +++ b/listvalidator/size_between_test.go @@ -111,7 +111,6 @@ func TestSizeBetweenValidator(t *testing.T) { } for name, test := range tests { - name, test := name, test t.Run(fmt.Sprintf("ValidateList - %s", name), func(t *testing.T) { t.Parallel() diff --git a/listvalidator/unique_values_test.go b/listvalidator/unique_values_test.go index 51b49ad6..235d2b55 100644 --- a/listvalidator/unique_values_test.go +++ b/listvalidator/unique_values_test.go @@ -9,13 +9,14 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/function" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/types" + + "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" ) func TestUniqueValues(t *testing.T) { @@ -148,7 +149,6 @@ func TestUniqueValues(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(fmt.Sprintf("ValidateList - %s", name), func(t *testing.T) { t.Parallel() diff --git a/listvalidator/value_float32s_are_test.go b/listvalidator/value_float32s_are_test.go index c54049b7..4d7c1dcf 100644 --- a/listvalidator/value_float32s_are_test.go +++ b/listvalidator/value_float32s_are_test.go @@ -125,7 +125,6 @@ func TestValueFloat32sAreValidatorValidateList(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/listvalidator/value_float64s_are_test.go b/listvalidator/value_float64s_are_test.go index 41f8bf75..f7aa5901 100644 --- a/listvalidator/value_float64s_are_test.go +++ b/listvalidator/value_float64s_are_test.go @@ -125,7 +125,6 @@ func TestValueFloat64sAreValidatorValidateList(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/listvalidator/value_int32s_are_test.go b/listvalidator/value_int32s_are_test.go index 4ea0070c..b471cec3 100644 --- a/listvalidator/value_int32s_are_test.go +++ b/listvalidator/value_int32s_are_test.go @@ -120,7 +120,6 @@ func TestValueInt32sAreValidatorValidateList(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/listvalidator/value_int64s_are_test.go b/listvalidator/value_int64s_are_test.go index ef1fc825..7f04ccd9 100644 --- a/listvalidator/value_int64s_are_test.go +++ b/listvalidator/value_int64s_are_test.go @@ -120,7 +120,6 @@ func TestValueInt64sAreValidatorValidateList(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/listvalidator/value_lists_are_test.go b/listvalidator/value_lists_are_test.go index 478c4ce3..a0a27d8e 100644 --- a/listvalidator/value_lists_are_test.go +++ b/listvalidator/value_lists_are_test.go @@ -172,7 +172,6 @@ func TestValueListsAreValidatorValidateList(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/listvalidator/value_maps_are_test.go b/listvalidator/value_maps_are_test.go index 8e761462..2bac8170 100644 --- a/listvalidator/value_maps_are_test.go +++ b/listvalidator/value_maps_are_test.go @@ -173,7 +173,6 @@ func TestValueMapsAreValidatorValidateList(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/listvalidator/value_numbers_are_test.go b/listvalidator/value_numbers_are_test.go index bbc850fa..3c659ad8 100644 --- a/listvalidator/value_numbers_are_test.go +++ b/listvalidator/value_numbers_are_test.go @@ -126,7 +126,6 @@ func TestValueNumbersAreValidatorValidateList(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/listvalidator/value_sets_are_test.go b/listvalidator/value_sets_are_test.go index 2d6cc4d1..677a5a32 100644 --- a/listvalidator/value_sets_are_test.go +++ b/listvalidator/value_sets_are_test.go @@ -173,7 +173,6 @@ func TestValueSetsAreValidatorValidateList(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/listvalidator/value_strings_are_test.go b/listvalidator/value_strings_are_test.go index 360ac2e7..e3049f29 100644 --- a/listvalidator/value_strings_are_test.go +++ b/listvalidator/value_strings_are_test.go @@ -120,7 +120,6 @@ func TestValueStringsAreValidatorValidateList(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/mapvalidator/all_test.go b/mapvalidator/all_test.go index 1a4e69fd..b3887464 100644 --- a/mapvalidator/all_test.go +++ b/mapvalidator/all_test.go @@ -68,7 +68,7 @@ func TestAllValidatorValidateMap(t *testing.T) { } for name, test := range tests { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() request := validator.MapRequest{ diff --git a/mapvalidator/any_test.go b/mapvalidator/any_test.go index eca5285b..d9fc1085 100644 --- a/mapvalidator/any_test.go +++ b/mapvalidator/any_test.go @@ -85,7 +85,7 @@ func TestAnyValidatorValidateMap(t *testing.T) { } for name, test := range tests { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() request := validator.MapRequest{ diff --git a/mapvalidator/any_with_all_warnings_test.go b/mapvalidator/any_with_all_warnings_test.go index 9b237150..1bc41d37 100644 --- a/mapvalidator/any_with_all_warnings_test.go +++ b/mapvalidator/any_with_all_warnings_test.go @@ -86,7 +86,7 @@ func TestAnyWithAllWarningsValidatorValidateMap(t *testing.T) { } for name, test := range tests { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() request := validator.MapRequest{ diff --git a/mapvalidator/keys_are_test.go b/mapvalidator/keys_are_test.go index a21dc980..8147b244 100644 --- a/mapvalidator/keys_are_test.go +++ b/mapvalidator/keys_are_test.go @@ -92,7 +92,7 @@ func TestKeysAreValidator(t *testing.T) { } for name, test := range tests { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() request := validator.MapRequest{ diff --git a/mapvalidator/size_at_least_test.go b/mapvalidator/size_at_least_test.go index 969b3c8a..171cacff 100644 --- a/mapvalidator/size_at_least_test.go +++ b/mapvalidator/size_at_least_test.go @@ -68,7 +68,6 @@ func TestSizeAtLeastValidator(t *testing.T) { } for name, test := range tests { - name, test := name, test t.Run(fmt.Sprintf("ValidateMap - %s", name), func(t *testing.T) { t.Parallel() diff --git a/mapvalidator/size_at_most_test.go b/mapvalidator/size_at_most_test.go index 5886bae6..9c15255f 100644 --- a/mapvalidator/size_at_most_test.go +++ b/mapvalidator/size_at_most_test.go @@ -72,7 +72,6 @@ func TestSizeAtMostValidator(t *testing.T) { } for name, test := range tests { - name, test := name, test t.Run(fmt.Sprintf("ValidateMap - %s", name), func(t *testing.T) { t.Parallel() diff --git a/mapvalidator/size_between_test.go b/mapvalidator/size_between_test.go index d95634c7..e57f6b7a 100644 --- a/mapvalidator/size_between_test.go +++ b/mapvalidator/size_between_test.go @@ -111,7 +111,6 @@ func TestSizeBetweenValidator(t *testing.T) { } for name, test := range tests { - name, test := name, test t.Run(fmt.Sprintf("ValidateMap - %s", name), func(t *testing.T) { t.Parallel() diff --git a/mapvalidator/value_float32s_are_test.go b/mapvalidator/value_float32s_are_test.go index 45743f95..cd4dc7ce 100644 --- a/mapvalidator/value_float32s_are_test.go +++ b/mapvalidator/value_float32s_are_test.go @@ -110,7 +110,6 @@ func TestValueFloat32sAreValidatorValidateMap(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/mapvalidator/value_float64s_are_test.go b/mapvalidator/value_float64s_are_test.go index 97dd8466..f34aa7c6 100644 --- a/mapvalidator/value_float64s_are_test.go +++ b/mapvalidator/value_float64s_are_test.go @@ -110,7 +110,6 @@ func TestValueFloat64sAreValidatorValidateMap(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/mapvalidator/value_int32s_are_test.go b/mapvalidator/value_int32s_are_test.go index dabb90fa..4184e7b1 100644 --- a/mapvalidator/value_int32s_are_test.go +++ b/mapvalidator/value_int32s_are_test.go @@ -110,7 +110,6 @@ func TestValueInt32sAreValidatorValidateMap(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/mapvalidator/value_int64s_are_test.go b/mapvalidator/value_int64s_are_test.go index c4295862..39f510f5 100644 --- a/mapvalidator/value_int64s_are_test.go +++ b/mapvalidator/value_int64s_are_test.go @@ -110,7 +110,6 @@ func TestValueInt64sAreValidatorValidateMap(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/mapvalidator/value_lists_are_test.go b/mapvalidator/value_lists_are_test.go index eebdb0ad..fed09386 100644 --- a/mapvalidator/value_lists_are_test.go +++ b/mapvalidator/value_lists_are_test.go @@ -146,7 +146,6 @@ func TestValueListsAreValidatorValidateMap(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/mapvalidator/value_maps_are_test.go b/mapvalidator/value_maps_are_test.go index 41ad0cbc..457fe376 100644 --- a/mapvalidator/value_maps_are_test.go +++ b/mapvalidator/value_maps_are_test.go @@ -145,7 +145,6 @@ func TestValueMapsAreValidatorValidateMap(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/mapvalidator/value_numbers_are_test.go b/mapvalidator/value_numbers_are_test.go index a20d3fd9..121529f7 100644 --- a/mapvalidator/value_numbers_are_test.go +++ b/mapvalidator/value_numbers_are_test.go @@ -111,7 +111,6 @@ func TestValueNumbersAreValidatorValidateMap(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/mapvalidator/value_sets_are_test.go b/mapvalidator/value_sets_are_test.go index 527be84e..88912933 100644 --- a/mapvalidator/value_sets_are_test.go +++ b/mapvalidator/value_sets_are_test.go @@ -146,7 +146,6 @@ func TestValueSetsAreValidatorValidateMap(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/mapvalidator/value_strings_are_test.go b/mapvalidator/value_strings_are_test.go index 19ace181..fa494cec 100644 --- a/mapvalidator/value_strings_are_test.go +++ b/mapvalidator/value_strings_are_test.go @@ -110,7 +110,6 @@ func TestValueStringsAreValidatorValidateMap(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/numbervalidator/all_test.go b/numbervalidator/all_test.go index 5ba266b4..9ab71c47 100644 --- a/numbervalidator/all_test.go +++ b/numbervalidator/all_test.go @@ -56,7 +56,7 @@ func TestAllValidatorValidateNumber(t *testing.T) { } for name, test := range tests { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() request := validator.NumberRequest{ diff --git a/numbervalidator/any_test.go b/numbervalidator/any_test.go index 06e81fd0..8a9c93a4 100644 --- a/numbervalidator/any_test.go +++ b/numbervalidator/any_test.go @@ -67,7 +67,7 @@ func TestAnyValidatorValidateNumber(t *testing.T) { } for name, test := range tests { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() request := validator.NumberRequest{ diff --git a/numbervalidator/any_with_all_warnings_test.go b/numbervalidator/any_with_all_warnings_test.go index f7836226..c25eefce 100644 --- a/numbervalidator/any_with_all_warnings_test.go +++ b/numbervalidator/any_with_all_warnings_test.go @@ -68,7 +68,7 @@ func TestAnyWithAllWarningsValidatorValidateNumber(t *testing.T) { } for name, test := range tests { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() request := validator.NumberRequest{ diff --git a/numbervalidator/none_of_test.go b/numbervalidator/none_of_test.go index a381ffa7..a238a65e 100644 --- a/numbervalidator/none_of_test.go +++ b/numbervalidator/none_of_test.go @@ -63,7 +63,6 @@ func TestNoneOfValidator(t *testing.T) { } for name, test := range testCases { - name, test := name, test t.Run(fmt.Sprintf("ValidateNumber - %s", name), func(t *testing.T) { t.Parallel() diff --git a/numbervalidator/one_of_test.go b/numbervalidator/one_of_test.go index a79aed16..2c516bb6 100644 --- a/numbervalidator/one_of_test.go +++ b/numbervalidator/one_of_test.go @@ -63,7 +63,6 @@ func TestOneOfValidator(t *testing.T) { } for name, test := range testCases { - name, test := name, test t.Run(fmt.Sprintf("ValidateNumber - %s", name), func(t *testing.T) { t.Parallel() diff --git a/objectvalidator/all_test.go b/objectvalidator/all_test.go index 94df3c24..fbb3e06e 100644 --- a/objectvalidator/all_test.go +++ b/objectvalidator/all_test.go @@ -82,7 +82,7 @@ func TestAllValidatorValidateObject(t *testing.T) { } for name, test := range tests { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() request := validator.ObjectRequest{ diff --git a/objectvalidator/any_test.go b/objectvalidator/any_test.go index 9280ef09..5850f71a 100644 --- a/objectvalidator/any_test.go +++ b/objectvalidator/any_test.go @@ -125,7 +125,7 @@ func TestAnyValidatorValidateObject(t *testing.T) { } for name, test := range tests { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() request := validator.ObjectRequest{ diff --git a/objectvalidator/any_with_all_warnings_test.go b/objectvalidator/any_with_all_warnings_test.go index ea98e882..d595ec1f 100644 --- a/objectvalidator/any_with_all_warnings_test.go +++ b/objectvalidator/any_with_all_warnings_test.go @@ -130,7 +130,7 @@ func TestAnyWithAllWarningsValidatorValidateObject(t *testing.T) { } for name, test := range tests { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() request := validator.ObjectRequest{ diff --git a/objectvalidator/is_required_test.go b/objectvalidator/is_required_test.go index 8d67bd59..5a900c66 100644 --- a/objectvalidator/is_required_test.go +++ b/objectvalidator/is_required_test.go @@ -7,11 +7,12 @@ import ( "context" "testing" - "github.com/hashicorp/terraform-plugin-framework-validators/objectvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/types" + + "github.com/hashicorp/terraform-plugin-framework-validators/objectvalidator" ) func TestIsRequiredValidator(t *testing.T) { @@ -63,7 +64,7 @@ func TestIsRequiredValidator(t *testing.T) { } for name, test := range tests { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() request := validator.ObjectRequest{ diff --git a/providervalidator/all_test.go b/providervalidator/all_test.go index a431e131..93836ea4 100644 --- a/providervalidator/all_test.go +++ b/providervalidator/all_test.go @@ -161,7 +161,6 @@ func TestAllValidatorValidateProvider(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/providervalidator/any_test.go b/providervalidator/any_test.go index e5557e49..309d2567 100644 --- a/providervalidator/any_test.go +++ b/providervalidator/any_test.go @@ -138,7 +138,6 @@ func TestAnyValidatorValidateProvider(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/providervalidator/any_with_all_warnings_test.go b/providervalidator/any_with_all_warnings_test.go index e67d05ec..f5d886ce 100644 --- a/providervalidator/any_with_all_warnings_test.go +++ b/providervalidator/any_with_all_warnings_test.go @@ -199,7 +199,6 @@ func TestAnyWithAllWarningsValidatorValidateProvider(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/providervalidator/at_least_one_of_test.go b/providervalidator/at_least_one_of_test.go index 40b62d34..12971e72 100644 --- a/providervalidator/at_least_one_of_test.go +++ b/providervalidator/at_least_one_of_test.go @@ -8,13 +8,14 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/hashicorp/terraform-plugin-framework-validators/providervalidator" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/provider" "github.com/hashicorp/terraform-plugin-framework/provider/schema" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-go/tftypes" + + "github.com/hashicorp/terraform-plugin-framework-validators/providervalidator" ) func TestAtLeastOneOf(t *testing.T) { @@ -105,7 +106,6 @@ func TestAtLeastOneOf(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/providervalidator/conflicting_test.go b/providervalidator/conflicting_test.go index b7a5a57e..456ea42b 100644 --- a/providervalidator/conflicting_test.go +++ b/providervalidator/conflicting_test.go @@ -8,13 +8,14 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/hashicorp/terraform-plugin-framework-validators/providervalidator" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/provider" "github.com/hashicorp/terraform-plugin-framework/provider/schema" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-go/tftypes" + + "github.com/hashicorp/terraform-plugin-framework-validators/providervalidator" ) func TestConflicting(t *testing.T) { @@ -106,7 +107,6 @@ func TestConflicting(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/providervalidator/exactly_one_of_test.go b/providervalidator/exactly_one_of_test.go index 8af6211a..1561466b 100644 --- a/providervalidator/exactly_one_of_test.go +++ b/providervalidator/exactly_one_of_test.go @@ -8,13 +8,14 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/hashicorp/terraform-plugin-framework-validators/providervalidator" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/provider" "github.com/hashicorp/terraform-plugin-framework/provider/schema" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-go/tftypes" + + "github.com/hashicorp/terraform-plugin-framework-validators/providervalidator" ) func TestExactlyOneOf(t *testing.T) { @@ -106,7 +107,6 @@ func TestExactlyOneOf(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/providervalidator/required_together_test.go b/providervalidator/required_together_test.go index db39fae0..e552e3fd 100644 --- a/providervalidator/required_together_test.go +++ b/providervalidator/required_together_test.go @@ -8,13 +8,14 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/hashicorp/terraform-plugin-framework-validators/providervalidator" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/provider" "github.com/hashicorp/terraform-plugin-framework/provider/schema" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-go/tftypes" + + "github.com/hashicorp/terraform-plugin-framework-validators/providervalidator" ) func TestRequiredTogether(t *testing.T) { @@ -106,7 +107,6 @@ func TestRequiredTogether(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/resourcevalidator/all_test.go b/resourcevalidator/all_test.go index a55dfb57..bd91e197 100644 --- a/resourcevalidator/all_test.go +++ b/resourcevalidator/all_test.go @@ -161,7 +161,6 @@ func TestAllValidatorValidateResource(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/resourcevalidator/any_test.go b/resourcevalidator/any_test.go index 8e318012..1f0ff6f9 100644 --- a/resourcevalidator/any_test.go +++ b/resourcevalidator/any_test.go @@ -138,7 +138,6 @@ func TestAnyValidatorValidateResource(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/resourcevalidator/any_with_all_warnings_test.go b/resourcevalidator/any_with_all_warnings_test.go index 13bbd355..43353a00 100644 --- a/resourcevalidator/any_with_all_warnings_test.go +++ b/resourcevalidator/any_with_all_warnings_test.go @@ -199,7 +199,6 @@ func TestAnyWithAllWarningsValidatorValidateResource(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/resourcevalidator/at_least_one_of_test.go b/resourcevalidator/at_least_one_of_test.go index 952bce5f..2d563688 100644 --- a/resourcevalidator/at_least_one_of_test.go +++ b/resourcevalidator/at_least_one_of_test.go @@ -8,13 +8,14 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/hashicorp/terraform-plugin-framework-validators/resourcevalidator" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/resource/schema" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-go/tftypes" + + "github.com/hashicorp/terraform-plugin-framework-validators/resourcevalidator" ) func TestAtLeastOneOf(t *testing.T) { @@ -105,7 +106,6 @@ func TestAtLeastOneOf(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/resourcevalidator/conflicting_test.go b/resourcevalidator/conflicting_test.go index e73f4a58..01148a77 100644 --- a/resourcevalidator/conflicting_test.go +++ b/resourcevalidator/conflicting_test.go @@ -8,13 +8,14 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/hashicorp/terraform-plugin-framework-validators/resourcevalidator" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/resource/schema" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-go/tftypes" + + "github.com/hashicorp/terraform-plugin-framework-validators/resourcevalidator" ) func TestConflicting(t *testing.T) { @@ -106,7 +107,6 @@ func TestConflicting(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/resourcevalidator/exactly_one_of_test.go b/resourcevalidator/exactly_one_of_test.go index 7825b54f..9dfeb1f1 100644 --- a/resourcevalidator/exactly_one_of_test.go +++ b/resourcevalidator/exactly_one_of_test.go @@ -8,13 +8,14 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/hashicorp/terraform-plugin-framework-validators/resourcevalidator" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/resource/schema" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-go/tftypes" + + "github.com/hashicorp/terraform-plugin-framework-validators/resourcevalidator" ) func TestExactlyOneOf(t *testing.T) { @@ -106,7 +107,6 @@ func TestExactlyOneOf(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/resourcevalidator/required_together_test.go b/resourcevalidator/required_together_test.go index 6db54425..7b9a9e48 100644 --- a/resourcevalidator/required_together_test.go +++ b/resourcevalidator/required_together_test.go @@ -8,13 +8,14 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/hashicorp/terraform-plugin-framework-validators/resourcevalidator" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/resource/schema" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-go/tftypes" + + "github.com/hashicorp/terraform-plugin-framework-validators/resourcevalidator" ) func TestRequiredTogether(t *testing.T) { @@ -106,7 +107,6 @@ func TestRequiredTogether(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/setvalidator/all_test.go b/setvalidator/all_test.go index b1e372f2..eaafe8b5 100644 --- a/setvalidator/all_test.go +++ b/setvalidator/all_test.go @@ -68,7 +68,7 @@ func TestAllValidatorValidateSet(t *testing.T) { } for name, test := range tests { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() request := validator.SetRequest{ diff --git a/setvalidator/any_test.go b/setvalidator/any_test.go index e326daad..d609480a 100644 --- a/setvalidator/any_test.go +++ b/setvalidator/any_test.go @@ -85,7 +85,7 @@ func TestAnyValidatorValidateSet(t *testing.T) { } for name, test := range tests { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() request := validator.SetRequest{ diff --git a/setvalidator/any_with_all_warnings_test.go b/setvalidator/any_with_all_warnings_test.go index b8944014..211b1caa 100644 --- a/setvalidator/any_with_all_warnings_test.go +++ b/setvalidator/any_with_all_warnings_test.go @@ -86,7 +86,7 @@ func TestAnyWithAllWarningsValidatorValidateSet(t *testing.T) { } for name, test := range tests { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() request := validator.SetRequest{ diff --git a/setvalidator/is_required_test.go b/setvalidator/is_required_test.go index c71354c2..fdbf424b 100644 --- a/setvalidator/is_required_test.go +++ b/setvalidator/is_required_test.go @@ -7,11 +7,12 @@ import ( "context" "testing" - "github.com/hashicorp/terraform-plugin-framework-validators/setvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/types" + + "github.com/hashicorp/terraform-plugin-framework-validators/setvalidator" ) func TestIsRequiredValidator(t *testing.T) { @@ -53,7 +54,7 @@ func TestIsRequiredValidator(t *testing.T) { } for name, test := range tests { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() request := validator.SetRequest{ diff --git a/setvalidator/size_at_least_test.go b/setvalidator/size_at_least_test.go index e76da98f..de93cfb4 100644 --- a/setvalidator/size_at_least_test.go +++ b/setvalidator/size_at_least_test.go @@ -68,7 +68,6 @@ func TestSizeAtLeastValidator(t *testing.T) { } for name, test := range tests { - name, test := name, test t.Run(fmt.Sprintf("ValidateSet - %s", name), func(t *testing.T) { t.Parallel() diff --git a/setvalidator/size_at_most_test.go b/setvalidator/size_at_most_test.go index 0cebc4d7..8bac993b 100644 --- a/setvalidator/size_at_most_test.go +++ b/setvalidator/size_at_most_test.go @@ -72,7 +72,6 @@ func TestSizeAtMostValidator(t *testing.T) { } for name, test := range tests { - name, test := name, test t.Run(fmt.Sprintf("ValidateSet - %s", name), func(t *testing.T) { t.Parallel() diff --git a/setvalidator/size_between_test.go b/setvalidator/size_between_test.go index 0b24e7e4..b8da367b 100644 --- a/setvalidator/size_between_test.go +++ b/setvalidator/size_between_test.go @@ -111,7 +111,6 @@ func TestSizeBetweenValidator(t *testing.T) { } for name, test := range tests { - name, test := name, test t.Run(fmt.Sprintf("ValidateSet - %s", name), func(t *testing.T) { t.Parallel() diff --git a/setvalidator/value_float32s_are_test.go b/setvalidator/value_float32s_are_test.go index 51051f06..fa3de8b5 100644 --- a/setvalidator/value_float32s_are_test.go +++ b/setvalidator/value_float32s_are_test.go @@ -125,7 +125,6 @@ func TestValueFloat32sAreValidatorValidateSet(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/setvalidator/value_float64s_are_test.go b/setvalidator/value_float64s_are_test.go index 71a140f4..49c6b892 100644 --- a/setvalidator/value_float64s_are_test.go +++ b/setvalidator/value_float64s_are_test.go @@ -125,7 +125,6 @@ func TestValueFloat64sAreValidatorValidateSet(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/setvalidator/value_int32s_are_test.go b/setvalidator/value_int32s_are_test.go index 487ef96e..a21eaeee 100644 --- a/setvalidator/value_int32s_are_test.go +++ b/setvalidator/value_int32s_are_test.go @@ -125,7 +125,6 @@ func TestValueInt32sAreValidatorValidateSet(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/setvalidator/value_int64s_are_test.go b/setvalidator/value_int64s_are_test.go index b8b6b82d..745a46cd 100644 --- a/setvalidator/value_int64s_are_test.go +++ b/setvalidator/value_int64s_are_test.go @@ -125,7 +125,6 @@ func TestValueInt64sAreValidatorValidateSet(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/setvalidator/value_lists_are_test.go b/setvalidator/value_lists_are_test.go index b4de73d7..3448c103 100644 --- a/setvalidator/value_lists_are_test.go +++ b/setvalidator/value_lists_are_test.go @@ -209,7 +209,6 @@ func TestValueListsAreValidatorValidateSet(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/setvalidator/value_maps_are_test.go b/setvalidator/value_maps_are_test.go index 340ff760..9d9bba93 100644 --- a/setvalidator/value_maps_are_test.go +++ b/setvalidator/value_maps_are_test.go @@ -203,7 +203,6 @@ func TestValueMapsAreValidatorValidateSet(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/setvalidator/value_numbers_are_test.go b/setvalidator/value_numbers_are_test.go index 541b0f37..72d21e5b 100644 --- a/setvalidator/value_numbers_are_test.go +++ b/setvalidator/value_numbers_are_test.go @@ -126,7 +126,6 @@ func TestValueNumbersAreValidatorValidateSet(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/setvalidator/value_sets_are_test.go b/setvalidator/value_sets_are_test.go index b0cb6ae4..ecc8cd66 100644 --- a/setvalidator/value_sets_are_test.go +++ b/setvalidator/value_sets_are_test.go @@ -208,7 +208,6 @@ func TestValueSetsAreValidatorValidateSet(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/setvalidator/value_strings_are_test.go b/setvalidator/value_strings_are_test.go index 666141f2..0bbd5539 100644 --- a/setvalidator/value_strings_are_test.go +++ b/setvalidator/value_strings_are_test.go @@ -125,7 +125,6 @@ func TestValueStringsAreValidatorValidateSet(t *testing.T) { } for name, testCase := range testCases { - name, testCase := name, testCase t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/stringvalidator/all_test.go b/stringvalidator/all_test.go index 4d6a30ea..722a189e 100644 --- a/stringvalidator/all_test.go +++ b/stringvalidator/all_test.go @@ -55,7 +55,7 @@ func TestAllValidatorValidateString(t *testing.T) { } for name, test := range tests { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() request := validator.StringRequest{ diff --git a/stringvalidator/any_test.go b/stringvalidator/any_test.go index acab8f96..0377c5d3 100644 --- a/stringvalidator/any_test.go +++ b/stringvalidator/any_test.go @@ -66,7 +66,7 @@ func TestAnyValidatorValidateString(t *testing.T) { } for name, test := range tests { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() request := validator.StringRequest{ diff --git a/stringvalidator/any_with_all_warnings_test.go b/stringvalidator/any_with_all_warnings_test.go index 1bc1477c..e65f2796 100644 --- a/stringvalidator/any_with_all_warnings_test.go +++ b/stringvalidator/any_with_all_warnings_test.go @@ -67,7 +67,7 @@ func TestAnyWithAllWarningsValidatorValidateString(t *testing.T) { } for name, test := range tests { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() request := validator.StringRequest{ diff --git a/stringvalidator/length_at_least_test.go b/stringvalidator/length_at_least_test.go index 5ec51cb2..6daada66 100644 --- a/stringvalidator/length_at_least_test.go +++ b/stringvalidator/length_at_least_test.go @@ -55,7 +55,6 @@ func TestLengthAtLeastValidator(t *testing.T) { } for name, test := range tests { - name, test := name, test t.Run(fmt.Sprintf("ValidateString - %s", name), func(t *testing.T) { t.Parallel() diff --git a/stringvalidator/length_at_most_test.go b/stringvalidator/length_at_most_test.go index 6eeca554..f3f13598 100644 --- a/stringvalidator/length_at_most_test.go +++ b/stringvalidator/length_at_most_test.go @@ -56,7 +56,6 @@ func TestLengthAtMostValidator(t *testing.T) { } for name, test := range tests { - name, test := name, test t.Run(fmt.Sprintf("ValidateString - %s", name), func(t *testing.T) { t.Parallel() diff --git a/stringvalidator/length_between_test.go b/stringvalidator/length_between_test.go index cf3db9b2..6270a772 100644 --- a/stringvalidator/length_between_test.go +++ b/stringvalidator/length_between_test.go @@ -94,7 +94,6 @@ func TestLengthBetweenValidator(t *testing.T) { } for name, test := range tests { - name, test := name, test t.Run(fmt.Sprintf("ValidateString - %s", name), func(t *testing.T) { t.Parallel() diff --git a/stringvalidator/none_of_case_insensitive_test.go b/stringvalidator/none_of_case_insensitive_test.go index 6f921f6c..52e67975 100644 --- a/stringvalidator/none_of_case_insensitive_test.go +++ b/stringvalidator/none_of_case_insensitive_test.go @@ -71,7 +71,6 @@ func TestNoneOfCaseInsensitiveValidator(t *testing.T) { } for name, test := range testCases { - name, test := name, test t.Run(fmt.Sprintf("ValidateString - %s", name), func(t *testing.T) { t.Parallel() @@ -125,7 +124,7 @@ func TestNoneOfCaseInsensitiveValidator_Description(t *testing.T) { } for name, test := range testCases { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/stringvalidator/none_of_test.go b/stringvalidator/none_of_test.go index 72ce0285..c2e53435 100644 --- a/stringvalidator/none_of_test.go +++ b/stringvalidator/none_of_test.go @@ -70,7 +70,6 @@ func TestNoneOfValidator(t *testing.T) { } for name, test := range testCases { - name, test := name, test t.Run(fmt.Sprintf("ValidateString - %s", name), func(t *testing.T) { t.Parallel() @@ -124,7 +123,7 @@ func TestNoneOfValidator_Description(t *testing.T) { } for name, test := range testCases { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/stringvalidator/one_of_case_insensitive_test.go b/stringvalidator/one_of_case_insensitive_test.go index aa6be52a..96da0684 100644 --- a/stringvalidator/one_of_case_insensitive_test.go +++ b/stringvalidator/one_of_case_insensitive_test.go @@ -70,7 +70,6 @@ func TestOneOfCaseInsensitiveValidator(t *testing.T) { } for name, test := range testCases { - name, test := name, test t.Run(fmt.Sprintf("ValidateString - %s", name), func(t *testing.T) { t.Parallel() @@ -124,7 +123,7 @@ func TestOneOfCaseInsensitiveValidator_Description(t *testing.T) { } for name, test := range testCases { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/stringvalidator/one_of_test.go b/stringvalidator/one_of_test.go index e2935631..c4c2d6a4 100644 --- a/stringvalidator/one_of_test.go +++ b/stringvalidator/one_of_test.go @@ -71,7 +71,6 @@ func TestOneOfValidator(t *testing.T) { } for name, test := range testCases { - name, test := name, test t.Run(fmt.Sprintf("ValidateString - %s", name), func(t *testing.T) { t.Parallel() @@ -125,7 +124,7 @@ func TestOneOfValidator_Description(t *testing.T) { } for name, test := range testCases { - name, test := name, test + t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/stringvalidator/regex_matches_test.go b/stringvalidator/regex_matches_test.go index f591b7fe..f84efa9e 100644 --- a/stringvalidator/regex_matches_test.go +++ b/stringvalidator/regex_matches_test.go @@ -46,7 +46,6 @@ func TestRegexMatchesValidator(t *testing.T) { } for name, test := range tests { - name, test := name, test t.Run(fmt.Sprintf("ValidateString - %s", name), func(t *testing.T) { t.Parallel() diff --git a/stringvalidator/utf8_length_at_least_test.go b/stringvalidator/utf8_length_at_least_test.go index 27f00724..f18525f8 100644 --- a/stringvalidator/utf8_length_at_least_test.go +++ b/stringvalidator/utf8_length_at_least_test.go @@ -72,7 +72,6 @@ func TestUTF8LengthAtLeastValidator(t *testing.T) { } for name, test := range tests { - name, test := name, test t.Run(fmt.Sprintf("ValidateString - %s", name), func(t *testing.T) { t.Parallel() diff --git a/stringvalidator/utf8_length_at_most_test.go b/stringvalidator/utf8_length_at_most_test.go index ce70d88d..0dd450cb 100644 --- a/stringvalidator/utf8_length_at_most_test.go +++ b/stringvalidator/utf8_length_at_most_test.go @@ -72,7 +72,6 @@ func TestUTF8LengthAtMostValidator(t *testing.T) { } for name, test := range tests { - name, test := name, test t.Run(fmt.Sprintf("ValidateString - %s", name), func(t *testing.T) { t.Parallel() diff --git a/stringvalidator/utf8_length_between_test.go b/stringvalidator/utf8_length_between_test.go index 9a0b04e5..b002019f 100644 --- a/stringvalidator/utf8_length_between_test.go +++ b/stringvalidator/utf8_length_between_test.go @@ -94,7 +94,6 @@ func TestUTF8LengthBetweenValidator(t *testing.T) { } for name, test := range tests { - name, test := name, test t.Run(fmt.Sprintf("ValidateString - %s", name), func(t *testing.T) { t.Parallel()