Skip to content

Commit

Permalink
Merge pull request #7996 from terraform-providers/td-staticcheck-st1008
Browse files Browse the repository at this point in the history
Enable staticcheck ST1008
  • Loading branch information
bflad authored Mar 18, 2019
2 parents e87bdd4 + d79a438 commit 4700459
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
12 changes: 6 additions & 6 deletions aws/resource_aws_autoscaling_schedule.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func resourceAwsAutoscalingScheduleCreate(d *schema.ResourceData, meta interface
}

func resourceAwsAutoscalingScheduleRead(d *schema.ResourceData, meta interface{}) error {
sa, err, exists := resourceAwsASGScheduledActionRetrieve(d, meta)
sa, exists, err := resourceAwsASGScheduledActionRetrieve(d, meta)
if err != nil {
return err
}
Expand Down Expand Up @@ -189,7 +189,7 @@ func resourceAwsAutoscalingScheduleDelete(d *schema.ResourceData, meta interface
return nil
}

func resourceAwsASGScheduledActionRetrieve(d *schema.ResourceData, meta interface{}) (*autoscaling.ScheduledUpdateGroupAction, error, bool) {
func resourceAwsASGScheduledActionRetrieve(d *schema.ResourceData, meta interface{}) (*autoscaling.ScheduledUpdateGroupAction, bool, error) {
autoscalingconn := meta.(*AWSClient).autoscalingconn

params := &autoscaling.DescribeScheduledActionsInput{
Expand All @@ -205,15 +205,15 @@ func resourceAwsASGScheduledActionRetrieve(d *schema.ResourceData, meta interfac
log.Printf("[WARN] Autoscaling Scheduled Action (%s) not found, removing from state", d.Id())
d.SetId("")

return nil, nil, false
return nil, false, nil
}
return nil, fmt.Errorf("Error retrieving Autoscaling Scheduled Actions: %s", err), false
return nil, false, fmt.Errorf("Error retrieving Autoscaling Scheduled Actions: %s", err)
}

if len(actions.ScheduledUpdateGroupActions) != 1 ||
*actions.ScheduledUpdateGroupActions[0].ScheduledActionName != d.Id() {
return nil, nil, false
return nil, false, nil
}

return actions.ScheduledUpdateGroupActions[0], nil, true
return actions.ScheduledUpdateGroupActions[0], true, nil
}
1 change: 0 additions & 1 deletion staticcheck.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ checks = [
"-ST1000",
"-ST1003",
"-ST1005",
"-ST1008",
"-ST1012",
"-S1034"
]

0 comments on commit 4700459

Please sign in to comment.