Skip to content
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
6 changes: 3 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
issues:
max-per-linter: 0
max-issues-per-linter: 0
max-same-issues: 0

linters:
disable-all: true
enable:
- copyloopvar
- durationcheck
- errcheck
- exportloopref
- forcetypeassert
- gofmt
- gosimple
Expand All @@ -19,7 +19,7 @@ linters:
- paralleltest
- predeclared
- staticcheck
- tenv
- unconvert
- unparam
- unused
- usetesting
8 changes: 4 additions & 4 deletions datasource/timeouts/schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func TestBlockWithOpts(t *testing.T) {
}

for name, test := range tests {
name, test := name, test

t.Run(name, func(t *testing.T) {
t.Parallel()
actual := timeouts.BlockWithOpts(context.Background(), test.opts)
Expand Down Expand Up @@ -118,7 +118,7 @@ func TestBlock(t *testing.T) {
}

for name, test := range tests {
name, test := name, test

t.Run(name, func(t *testing.T) {
t.Parallel()
actual := timeouts.Block(context.Background())
Expand Down Expand Up @@ -189,7 +189,7 @@ func TestAttributesWithOpts(t *testing.T) {
}

for name, test := range tests {
name, test := name, test

t.Run(name, func(t *testing.T) {
t.Parallel()
actual := timeouts.AttributesWithOpts(context.Background(), test.opts)
Expand Down Expand Up @@ -234,7 +234,7 @@ func TestAttributes(t *testing.T) {
}

for name, test := range tests {
name, test := name, test

t.Run(name, func(t *testing.T) {
t.Parallel()
actual := timeouts.Attributes(context.Background())
Expand Down
1 change: 1 addition & 0 deletions datasource/timeouts/timeouts.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ func (t Value) getTimeout(ctx context.Context, timeoutName string, defaultTimeou

// No type assertion check is required as the schema guarantees that the object attributes
// are types.String.
//nolint:forcetypeassert
timeout, err := time.ParseDuration(value.(types.String).ValueString())
if err != nil {
diags.Append(diag.NewErrorDiagnostic(
Expand Down
6 changes: 3 additions & 3 deletions datasource/timeouts/timeouts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func TestTimeoutsTypeValueFromTerraform(t *testing.T) {
}

for name, test := range tests {
name, test := name, test

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -127,7 +127,7 @@ func TestTimeoutsTypeEqual(t *testing.T) {
},
}
for name, test := range tests {
name, test := name, test

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -216,7 +216,7 @@ func TestTimeoutsValueRead(t *testing.T) {
}

for name, test := range tests {
name, test := name, test

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down
8 changes: 4 additions & 4 deletions ephemeral/timeouts/schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func TestBlockWithOpts(t *testing.T) {
}

for name, test := range tests {
name, test := name, test

t.Run(name, func(t *testing.T) {
t.Parallel()
actual := timeouts.BlockWithOpts(context.Background(), test.opts)
Expand Down Expand Up @@ -118,7 +118,7 @@ func TestBlock(t *testing.T) {
}

for name, test := range tests {
name, test := name, test

t.Run(name, func(t *testing.T) {
t.Parallel()
actual := timeouts.Block(context.Background())
Expand Down Expand Up @@ -189,7 +189,7 @@ func TestAttributesWithOpts(t *testing.T) {
}

for name, test := range tests {
name, test := name, test

t.Run(name, func(t *testing.T) {
t.Parallel()
actual := timeouts.AttributesWithOpts(context.Background(), test.opts)
Expand Down Expand Up @@ -234,7 +234,7 @@ func TestAttributes(t *testing.T) {
}

for name, test := range tests {
name, test := name, test

t.Run(name, func(t *testing.T) {
t.Parallel()
actual := timeouts.Attributes(context.Background())
Expand Down
1 change: 1 addition & 0 deletions ephemeral/timeouts/timeouts.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ func (t Value) getTimeout(ctx context.Context, timeoutName string, defaultTimeou

// No type assertion check is required as the schema guarantees that the object attributes
// are types.String.
//nolint:forcetypeassert
timeout, err := time.ParseDuration(value.(types.String).ValueString())
if err != nil {
diags.Append(diag.NewErrorDiagnostic(
Expand Down
6 changes: 3 additions & 3 deletions ephemeral/timeouts/timeouts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func TestTimeoutsTypeValueFromTerraform(t *testing.T) {
}

for name, test := range tests {
name, test := name, test

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -127,7 +127,7 @@ func TestTimeoutsTypeEqual(t *testing.T) {
},
}
for name, test := range tests {
name, test := name, test

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -216,7 +216,7 @@ func TestTimeoutsValueOpen(t *testing.T) {
}

for name, test := range tests {
name, test := name, test

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 1 addition & 1 deletion internal/validators/timeduration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func TestTimeDuration(t *testing.T) {
}

for name, test := range tests {
name, test := name, test

t.Run(name, func(t *testing.T) {
t.Parallel()
request := validator.StringRequest{
Expand Down
4 changes: 2 additions & 2 deletions resource/timeouts/schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func TestBlock(t *testing.T) {
}

for name, test := range tests {
name, test := name, test

t.Run(name, func(t *testing.T) {
t.Parallel()
actual := timeouts.Block(context.Background(), test.opts)
Expand Down Expand Up @@ -379,7 +379,7 @@ func TestAttributes(t *testing.T) {
}

for name, test := range tests {
name, test := name, test

t.Run(name, func(t *testing.T) {
t.Parallel()
actual := timeouts.Attributes(context.Background(), test.opts)
Expand Down
1 change: 1 addition & 0 deletions resource/timeouts/timeouts.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ func (t Value) getTimeout(ctx context.Context, timeoutName string, defaultTimeou

// No type assertion check is required as the schema guarantees that the object attributes
// are types.String.
//nolint:forcetypeassert
timeout, err := time.ParseDuration(value.(types.String).ValueString())
if err != nil {
diags.Append(diag.NewErrorDiagnostic(
Expand Down
12 changes: 6 additions & 6 deletions resource/timeouts/timeouts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func TestTimeoutsTypeValueFromTerraform(t *testing.T) {
}

for name, test := range tests {
name, test := name, test

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -142,7 +142,7 @@ func TestTimeoutsTypeEqual(t *testing.T) {
},
}
for name, test := range tests {
name, test := name, test

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -231,7 +231,7 @@ func TestTimeoutsValueCreate(t *testing.T) {
}

for name, test := range tests {
name, test := name, test

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -325,7 +325,7 @@ func TestTimeoutsValueRead(t *testing.T) {
}

for name, test := range tests {
name, test := name, test

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -419,7 +419,7 @@ func TestTimeoutsValueUpdate(t *testing.T) {
}

for name, test := range tests {
name, test := name, test

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -513,7 +513,7 @@ func TestTimeoutsValueDelete(t *testing.T) {
}

for name, test := range tests {
name, test := name, test

t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down
Loading