Skip to content

Commit f96ffc5

Browse files
committed
r/aws_iam_policy_attachment: Use 'inttypes.IsZero'.
1 parent f3c5032 commit f96ffc5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

internal/service/iam/policy_attachment.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"context"
88
"errors"
99
"log"
10-
"reflect"
1110

1211
"github.com/aws/aws-sdk-go-v2/aws"
1312
"github.com/aws/aws-sdk-go-v2/service/iam"
@@ -22,6 +21,7 @@ import (
2221
"github.com/hashicorp/terraform-provider-aws/internal/flex"
2322
tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices"
2423
"github.com/hashicorp/terraform-provider-aws/internal/tfresource"
24+
inttypes "github.com/hashicorp/terraform-provider-aws/internal/types"
2525
"github.com/hashicorp/terraform-provider-aws/internal/verify"
2626
"github.com/hashicorp/terraform-provider-aws/names"
2727
)
@@ -275,10 +275,10 @@ func detachPolicyFromUsers(ctx context.Context, conn *iam.Client, users []string
275275
}
276276

277277
func findEntitiesForPolicyByARN(ctx context.Context, conn *iam.Client, arn string) ([]string, []string, []string, error) {
278-
input := &iam.ListEntitiesForPolicyInput{
278+
input := iam.ListEntitiesForPolicyInput{
279279
PolicyArn: aws.String(arn),
280280
}
281-
groups, roles, users, err := findEntitiesForPolicy(ctx, conn, input)
281+
groups, roles, users, err := findEntitiesForPolicy(ctx, conn, &input)
282282

283283
if err != nil {
284284
return nil, nil, nil, err
@@ -316,17 +316,17 @@ func findEntitiesForPolicy(ctx context.Context, conn *iam.Client, input *iam.Lis
316316
}
317317

318318
for _, v := range page.PolicyGroups {
319-
if !reflect.ValueOf(v).IsZero() {
319+
if p := &v; !inttypes.IsZero(p) {
320320
groups = append(groups, v)
321321
}
322322
}
323323
for _, v := range page.PolicyRoles {
324-
if !reflect.ValueOf(v).IsZero() {
324+
if p := &v; !inttypes.IsZero(p) {
325325
roles = append(roles, v)
326326
}
327327
}
328328
for _, v := range page.PolicyUsers {
329-
if !reflect.ValueOf(v).IsZero() {
329+
if p := &v; !inttypes.IsZero(p) {
330330
users = append(users, v)
331331
}
332332
}

0 commit comments

Comments
 (0)