Skip to content

Commit 690524f

Browse files
committed
Linter
1 parent fc04f4e commit 690524f

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

internal/clients/iampolicy/resource_iam_binding.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func (r *resourceBinding) Schema(_ context.Context, _ resource.SchemaRequest, re
104104
Attributes: r.parentSchema.Attributes,
105105
}
106106

107-
if resp.Schema.Attributes == nil || len(resp.Schema.Attributes) == 0 {
107+
if len(resp.Schema.Attributes) == 0 {
108108
resp.Schema.Attributes = baseBindingSchema
109109
} else {
110110
for k, v := range baseBindingSchema {

internal/clients/iampolicy/resource_iam_policy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ func (r *resourcePolicy) Schema(_ context.Context, _ resource.SchemaRequest, res
111111
Attributes: r.parentSchema.Attributes,
112112
}
113113

114-
if resp.Schema.Attributes == nil || len(resp.Schema.Attributes) == 0 {
114+
if len(resp.Schema.Attributes) == 0 {
115115
resp.Schema.Attributes = basePolicySchema
116116
} else {
117117
for k, v := range basePolicySchema {

internal/provider/packer/testutils/testclient/operation.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
package testclient
55

66
import (
7+
"errors"
78
"fmt"
89
"testing"
910
"time"
@@ -45,10 +46,10 @@ func WaitForOperation(
4546
switch *resp.Payload.Operation.State {
4647
case sharedmodels.HashicorpCloudOperationOperationStatePENDING:
4748
msg := fmt.Sprintf("==> Operation \"%s\" pending...", operationName)
48-
return fmt.Errorf(msg)
49+
return errors.New(msg)
4950
case sharedmodels.HashicorpCloudOperationOperationStateRUNNING:
5051
msg := fmt.Sprintf("==> Operation \"%s\" running...", operationName)
51-
return fmt.Errorf(msg)
52+
return errors.New(msg)
5253
case sharedmodels.HashicorpCloudOperationOperationStateDONE:
5354
default:
5455
t.Errorf("Operation returned unknown state: %s", *resp.Payload.Operation.State)

internal/providersdkv2/test_helpers_for_packer_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
package providersdkv2
55

66
import (
7+
"errors"
78
"fmt"
89
"net/http"
910
"testing"
@@ -110,10 +111,10 @@ func waitForOperation(
110111
switch *resp.Payload.Operation.State {
111112
case sharedmodels.HashicorpCloudOperationOperationStatePENDING:
112113
msg := fmt.Sprintf("==> Operation \"%s\" pending...", operationName)
113-
return fmt.Errorf(msg)
114+
return errors.New(msg)
114115
case sharedmodels.HashicorpCloudOperationOperationStateRUNNING:
115116
msg := fmt.Sprintf("==> Operation \"%s\" running...", operationName)
116-
return fmt.Errorf(msg)
117+
return errors.New(msg)
117118
case sharedmodels.HashicorpCloudOperationOperationStateDONE:
118119
default:
119120
t.Errorf("Operation returned unknown state: %s", *resp.Payload.Operation.State)

0 commit comments

Comments
 (0)