mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-10-01 16:21:06 +00:00
Remove duplicate []interface{} to []string method (#388)
This commit is contained in:
parent
6499b12395
commit
b082eb0b65
@ -63,7 +63,7 @@ func resourceBigtableTableCreate(d *schema.ResourceData, meta interface{}) error
|
|||||||
|
|
||||||
name := d.Get("name").(string)
|
name := d.Get("name").(string)
|
||||||
if v, ok := d.GetOk("split_keys"); ok {
|
if v, ok := d.GetOk("split_keys"); ok {
|
||||||
splitKeys := convertSchemaArrayToStringArray(v.([]interface{}))
|
splitKeys := convertStringArr(v.([]interface{}))
|
||||||
// This method may return before the table's creation is complete - we may need to wait until
|
// This method may return before the table's creation is complete - we may need to wait until
|
||||||
// it exists in the future.
|
// it exists in the future.
|
||||||
err = c.CreatePresplitTable(ctx, name, splitKeys)
|
err = c.CreatePresplitTable(ctx, name, splitKeys)
|
||||||
|
@ -422,9 +422,9 @@ func expandCors(configured []interface{}) []*storage.BucketCors {
|
|||||||
for _, raw := range configured {
|
for _, raw := range configured {
|
||||||
data := raw.(map[string]interface{})
|
data := raw.(map[string]interface{})
|
||||||
corsRule := storage.BucketCors{
|
corsRule := storage.BucketCors{
|
||||||
Origin: convertSchemaArrayToStringArray(data["origin"].([]interface{})),
|
Origin: convertStringArr(data["origin"].([]interface{})),
|
||||||
Method: convertSchemaArrayToStringArray(data["method"].([]interface{})),
|
Method: convertStringArr(data["method"].([]interface{})),
|
||||||
ResponseHeader: convertSchemaArrayToStringArray(data["response_header"].([]interface{})),
|
ResponseHeader: convertStringArr(data["response_header"].([]interface{})),
|
||||||
MaxAgeSeconds: int64(data["max_age_seconds"].(int)),
|
MaxAgeSeconds: int64(data["max_age_seconds"].(int)),
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -433,15 +433,6 @@ func expandCors(configured []interface{}) []*storage.BucketCors {
|
|||||||
return corsRules
|
return corsRules
|
||||||
}
|
}
|
||||||
|
|
||||||
func convertSchemaArrayToStringArray(input []interface{}) []string {
|
|
||||||
output := make([]string, 0, len(input))
|
|
||||||
for _, val := range input {
|
|
||||||
output = append(output, val.(string))
|
|
||||||
}
|
|
||||||
|
|
||||||
return output
|
|
||||||
}
|
|
||||||
|
|
||||||
func flattenCors(corsRules []*storage.BucketCors) []map[string]interface{} {
|
func flattenCors(corsRules []*storage.BucketCors) []map[string]interface{} {
|
||||||
corsRulesSchema := make([]map[string]interface{}, 0, len(corsRules))
|
corsRulesSchema := make([]map[string]interface{}, 0, len(corsRules))
|
||||||
for _, corsRule := range corsRules {
|
for _, corsRule := range corsRules {
|
||||||
|
Loading…
Reference in New Issue
Block a user