Skip to content

Commit

Permalink
Consolidate appends
Browse files Browse the repository at this point in the history
  • Loading branch information
rifelpet committed Mar 31, 2024
1 parent 08690f4 commit 2a1faaa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions pkg/resources/aws/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -1849,9 +1849,7 @@ func DeleteIAMRole(cloud fi.Cloud, r *resources.Resource) error {
}
return fmt.Errorf("error listing IAM role policies for %q: %v", roleName, err)
}
for _, policy := range page.PolicyNames {
policyNames = append(policyNames, policy)
}
policyNames = append(policyNames, page.PolicyNames...)
}
}

Expand Down
4 changes: 1 addition & 3 deletions upup/pkg/fi/cloudup/awstasks/iamrole.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,7 @@ func (_ *IAMRole) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *IAMRole) error
}
return fmt.Errorf("error listing IAM role policies: %v", err)
}
for _, policy := range page.PolicyNames {
policyNames = append(policyNames, policy)
}
policyNames = append(policyNames, page.PolicyNames...)
}
}

Expand Down

0 comments on commit 2a1faaa

Please sign in to comment.