From 7036d9e1c40d53dfa8926058bd51caa105abca9d Mon Sep 17 00:00:00 2001 From: "Ernest W. Durbin III" Date: Sun, 7 Aug 2016 23:19:57 -0400 Subject: [PATCH] d.SetId before return, may be up too late. pass `go tool vet` (great resource by the way) --- .../aws/resource_aws_load_balancer_backend_server_policy.go | 2 +- .../providers/aws/resource_aws_load_balancer_listener_policy.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/providers/aws/resource_aws_load_balancer_backend_server_policy.go b/builtin/providers/aws/resource_aws_load_balancer_backend_server_policy.go index d3759ffcb..325c4fd1a 100644 --- a/builtin/providers/aws/resource_aws_load_balancer_backend_server_policy.go +++ b/builtin/providers/aws/resource_aws_load_balancer_backend_server_policy.go @@ -77,8 +77,8 @@ func resourceAwsLoadBalancerBackendServerPoliciesRead(d *schema.ResourceData, me if err != nil { if ec2err, ok := err.(awserr.Error); ok { if ec2err.Code() == "LoadBalancerNotFound" { - return fmt.Errorf("LoadBalancerNotFound: %s", err) d.SetId("") + return fmt.Errorf("LoadBalancerNotFound: %s", err) } } return fmt.Errorf("Error retrieving ELB description: %s", err) diff --git a/builtin/providers/aws/resource_aws_load_balancer_listener_policy.go b/builtin/providers/aws/resource_aws_load_balancer_listener_policy.go index 2a13be1c3..d1c8cacbb 100644 --- a/builtin/providers/aws/resource_aws_load_balancer_listener_policy.go +++ b/builtin/providers/aws/resource_aws_load_balancer_listener_policy.go @@ -77,8 +77,8 @@ func resourceAwsLoadBalancerListenerPoliciesRead(d *schema.ResourceData, meta in if err != nil { if ec2err, ok := err.(awserr.Error); ok { if ec2err.Code() == "LoadBalancerNotFound" { - return fmt.Errorf("LoadBalancerNotFound: %s", err) d.SetId("") + return fmt.Errorf("LoadBalancerNotFound: %s", err) } } return fmt.Errorf("Error retrieving ELB description: %s", err)