Skip to content

chore: Update golangci-lint linters and apply fixes #265

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ linters:
enable:
- durationcheck
- errcheck
- exportloopref
- copyloopvar
- forcetypeassert
- gofmt
- gosimple
Expand All @@ -18,7 +18,7 @@ linters:
- paralleltest
- predeclared
- staticcheck
- tenv
- usetesting
- unconvert
- unparam
- unused
Expand Down
4 changes: 2 additions & 2 deletions boolvalidator/equals_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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()
Expand Down
1 change: 0 additions & 1 deletion datasourcevalidator/all_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 0 additions & 1 deletion datasourcevalidator/any_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 0 additions & 1 deletion datasourcevalidator/any_with_all_warnings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions datasourcevalidator/at_least_one_of_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions datasourcevalidator/conflicting_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions datasourcevalidator/exactly_one_of_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions datasourcevalidator/required_together_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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()
Expand Down
1 change: 0 additions & 1 deletion ephemeralvalidator/all_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 0 additions & 1 deletion ephemeralvalidator/any_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 0 additions & 1 deletion ephemeralvalidator/any_with_all_warnings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions ephemeralvalidator/at_least_one_of_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions ephemeralvalidator/conflicting_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions ephemeralvalidator/exactly_one_of_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions ephemeralvalidator/required_together_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion float32validator/all_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion float32validator/any_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion float32validator/any_with_all_warnings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
1 change: 0 additions & 1 deletion float32validator/at_least_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 0 additions & 1 deletion float32validator/at_most_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 0 additions & 1 deletion float32validator/between_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 0 additions & 1 deletion float32validator/none_of_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 0 additions & 1 deletion float32validator/one_of_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion float64validator/all_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion float64validator/any_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion float64validator/any_with_all_warnings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
1 change: 0 additions & 1 deletion float64validator/at_least_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 0 additions & 1 deletion float64validator/at_most_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Loading
Loading