Skip to content

Commit

Permalink
resource/aws_proxy_protocol_policy: Fixes for tfproviderlint R002 (#1…
Browse files Browse the repository at this point in the history
…2030)

Reference: #9952

Remove pointer value dereferences, which can cause potential panics and are extraneous as `Set()` automatically handles pointer types including when `nil`.

Previously:

```
aws/resource_aws_proxy_protocol_policy.go:97:25: R002: ResourceData.Set() pointer value dereference is extraneous
```

Output from acceptance testing:

```
--- PASS: TestAccAWSProxyProtocolPolicy_basic (40.77s)
```
  • Loading branch information
bflad authored Feb 21, 2020
1 parent fe39017 commit 2a9256f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions aws/resource_aws_proxy_protocol_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ func resourceAwsProxyProtocolPolicyCreate(d *schema.ResourceData, meta interface

func resourceAwsProxyProtocolPolicyRead(d *schema.ResourceData, meta interface{}) error {
elbconn := meta.(*AWSClient).elbconn
elbname := aws.String(d.Get("load_balancer").(string))
elbname := d.Get("load_balancer").(string)

// Retrieve the current ELB policies for updating the state
req := &elb.DescribeLoadBalancersInput{
LoadBalancerNames: []*string{elbname},
LoadBalancerNames: []*string{aws.String(elbname)},
}
resp, err := elbconn.DescribeLoadBalancers(req)
if err != nil {
Expand All @@ -94,7 +94,7 @@ func resourceAwsProxyProtocolPolicyRead(d *schema.ResourceData, meta interface{}
ports = append(ports, &ipstr)
}
d.Set("instance_ports", ports)
d.Set("load_balancer", *elbname)
d.Set("load_balancer", elbname)
return nil
}

Expand Down

0 comments on commit 2a9256f

Please sign in to comment.