Skip to content

Commit

Permalink
Merge pull request #13670 from terraform-providers/ap_unparam_linting…
Browse files Browse the repository at this point in the history
…_expandApiGatewayMethodParametersOperations

tech-debt/structure: remove always nil param from expandApiGatewayMethodParametersOperations func
  • Loading branch information
anGie44 authored Jun 12, 2020
2 parents 7c24737 + e779859 commit a56cfac
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
5 changes: 1 addition & 4 deletions aws/resource_aws_api_gateway_method.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,7 @@ func resourceAwsApiGatewayMethodUpdate(d *schema.ResourceData, meta interface{})
parameters[k] = value
}
}
ops, err := expandApiGatewayMethodParametersOperations(d, "request_parameters", "requestParameters")
if err != nil {
return err
}
ops := expandApiGatewayMethodParametersOperations(d, "request_parameters", "requestParameters")
operations = append(operations, ops...)
}

Expand Down
5 changes: 1 addition & 4 deletions aws/resource_aws_api_gateway_method_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,7 @@ func resourceAwsApiGatewayMethodResponseUpdate(d *schema.ResourceData, meta inte
}

if d.HasChange("response_parameters") {
ops, err := expandApiGatewayMethodParametersOperations(d, "response_parameters", "responseParameters")
if err != nil {
return err
}
ops := expandApiGatewayMethodParametersOperations(d, "response_parameters", "responseParameters")
operations = append(operations, ops...)
}

Expand Down
4 changes: 2 additions & 2 deletions aws/structure.go
Original file line number Diff line number Diff line change
Expand Up @@ -1916,7 +1916,7 @@ func deprecatedExpandApiGatewayMethodParametersJSONOperations(d *schema.Resource
return operations, nil
}

func expandApiGatewayMethodParametersOperations(d *schema.ResourceData, key string, prefix string) ([]*apigateway.PatchOperation, error) {
func expandApiGatewayMethodParametersOperations(d *schema.ResourceData, key string, prefix string) []*apigateway.PatchOperation {
operations := make([]*apigateway.PatchOperation, 0)

oldParameters, newParameters := d.GetChange(key)
Expand Down Expand Up @@ -1966,7 +1966,7 @@ func expandApiGatewayMethodParametersOperations(d *schema.ResourceData, key stri
}
}

return operations, nil
return operations
}

func expandCloudWatchLogMetricTransformations(m map[string]interface{}) []*cloudwatchlogs.MetricTransformation {
Expand Down

0 comments on commit a56cfac

Please sign in to comment.