Skip to content

Commit 5a46ea8

Browse files
committed
d/aws_iam_instance_profiles: Use 'inttypes.IsZero'.
1 parent 702d384 commit 5a46ea8

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

internal/service/iam/instance_profiles_data_source.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ package iam
55

66
import (
77
"context"
8-
"reflect"
98

109
"github.com/aws/aws-sdk-go-v2/aws"
1110
"github.com/aws/aws-sdk-go-v2/service/iam"
@@ -16,6 +15,7 @@ import (
1615
"github.com/hashicorp/terraform-provider-aws/internal/conns"
1716
"github.com/hashicorp/terraform-provider-aws/internal/errs"
1817
"github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag"
18+
inttypes "github.com/hashicorp/terraform-provider-aws/internal/types"
1919
"github.com/hashicorp/terraform-provider-aws/names"
2020
)
2121

@@ -51,7 +51,6 @@ func dataSourceInstanceProfiles() *schema.Resource {
5151

5252
func dataSourceInstanceProfilesRead(ctx context.Context, d *schema.ResourceData, meta any) diag.Diagnostics {
5353
var diags diag.Diagnostics
54-
5554
conn := meta.(*conns.AWSClient).IAMClient(ctx)
5655

5756
roleName := d.Get("role_name").(string)
@@ -78,12 +77,12 @@ func dataSourceInstanceProfilesRead(ctx context.Context, d *schema.ResourceData,
7877
}
7978

8079
func findInstanceProfilesForRole(ctx context.Context, conn *iam.Client, roleName string) ([]awstypes.InstanceProfile, error) {
81-
input := &iam.ListInstanceProfilesForRoleInput{
80+
input := iam.ListInstanceProfilesForRoleInput{
8281
RoleName: aws.String(roleName),
8382
}
8483
var output []awstypes.InstanceProfile
8584

86-
pages := iam.NewListInstanceProfilesForRolePaginator(conn, input)
85+
pages := iam.NewListInstanceProfilesForRolePaginator(conn, &input)
8786
for pages.HasMorePages() {
8887
page, err := pages.NextPage(ctx)
8988

@@ -99,7 +98,7 @@ func findInstanceProfilesForRole(ctx context.Context, conn *iam.Client, roleName
9998
}
10099

101100
for _, v := range page.InstanceProfiles {
102-
if !reflect.ValueOf(v).IsZero() {
101+
if p := &v; !inttypes.IsZero(p) {
103102
output = append(output, v)
104103
}
105104
}

0 commit comments

Comments
 (0)