Skip to content

Commit

Permalink
addressed feedback about reusing err variable and unneeded parens
Browse files Browse the repository at this point in the history
  • Loading branch information
m-s-austin committed May 19, 2015
1 parent 95e9c3a commit 9104378
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions builtin/providers/aws/resource_aws_s3_bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,13 +269,13 @@ func resourceAwsS3BucketDelete(d *schema.ResourceData, meta interface{}) error {
log.Printf("[DEBUG] S3 Bucket attempting to forceDestroy %+v", err)

bucket := d.Get("bucket").(string)
resp, listErr := s3conn.ListObjects(
resp, err := s3conn.ListObjects(
&s3.ListObjectsInput {
Bucket: aws.String(bucket),
},
)

if (listErr != nil) {
if err != nil {
return fmt.Errorf("[DEBUG] S3 Bucket list Objects err: %s", err)
}

Expand All @@ -286,16 +286,16 @@ func resourceAwsS3BucketDelete(d *schema.ResourceData, meta interface{}) error {
Key: v.Key,
}
}
_, deleteErr := s3conn.DeleteObjects(
_, err = s3conn.DeleteObjects(
&s3.DeleteObjectsInput {
Bucket: aws.String(bucket),
Delete: &s3.Delete{
Objects:objectsToDelete,
},
},
)
if (deleteErr != nil) {
return fmt.Errorf("[DEBUG] S3 Bucket force_destroy error deleting: %s", deleteErr)
if err != nil {
return fmt.Errorf("[DEBUG] S3 Bucket force_destroy error deleting: %s", err)
}

// attempting to delete again
Expand Down

0 comments on commit 9104378

Please sign in to comment.