diff --git a/.changelog/12539.txt b/.changelog/12539.txt new file mode 100644 index 00000000000..42b910df155 --- /dev/null +++ b/.changelog/12539.txt @@ -0,0 +1,3 @@ +```release-note:none + +``` \ No newline at end of file diff --git a/google/provider/universe/universe_domain_compute_test.go b/google/provider/universe/universe_domain_compute_test.go index 4ab89ce4c3a..6f8fd60b448 100644 --- a/google/provider/universe/universe_domain_compute_test.go +++ b/google/provider/universe/universe_domain_compute_test.go @@ -28,7 +28,7 @@ func TestAccUniverseDomainDisk(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), CheckDestroy: testAccCheckComputeDiskDestroyProducer(t), Steps: []resource.TestStep{ - resource.TestStep{ + { Config: testAccUniverseDomain_basic_disk(universeDomain), }, }, @@ -43,7 +43,7 @@ func TestAccDefaultUniverseDomainDisk(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), CheckDestroy: testAccCheckComputeDiskDestroyProducer(t), Steps: []resource.TestStep{ - resource.TestStep{ + { Config: testAccUniverseDomain_basic_disk(universeDomain), }, }, @@ -57,7 +57,7 @@ func TestAccDefaultUniverseDomain_doesNotMatchExplicit(t *testing.T) { PreCheck: func() { acctest.AccTestPreCheck(t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), Steps: []resource.TestStep{ - resource.TestStep{ + { Config: testAccUniverseDomain_basic_disk(universeDomainFake), ExpectError: regexp.MustCompile("Universe domain mismatch"), }, diff --git a/google/provider/universe/universe_domain_pubsub_test.go b/google/provider/universe/universe_domain_pubsub_test.go index 58fed856bd7..a553c0d5232 100644 --- a/google/provider/universe/universe_domain_pubsub_test.go +++ b/google/provider/universe/universe_domain_pubsub_test.go @@ -29,7 +29,7 @@ func TestAccUniverseDomainPubSub(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), CheckDestroy: testAccCheckPubsubSubscriptionDestroyProducer(t), Steps: []resource.TestStep{ - resource.TestStep{ + { Config: testAccUniverseDomain_basic_pubsub(universeDomain, topic, subscription), }, }, diff --git a/google/provider/universe/universe_domain_storage_test.go b/google/provider/universe/universe_domain_storage_test.go index a175b51b064..686e23e667c 100644 --- a/google/provider/universe/universe_domain_storage_test.go +++ b/google/provider/universe/universe_domain_storage_test.go @@ -26,7 +26,7 @@ func TestAccUniverseDomainStorage(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), CheckDestroy: testAccStorageBucketDestroyProducer(t), Steps: []resource.TestStep{ - resource.TestStep{ + { Config: testAccUniverseDomain_bucket(universeDomain, bucketName), }, }, diff --git a/google/services/assuredworkloads/resource_assured_workloads_workload.go b/google/services/assuredworkloads/resource_assured_workloads_workload.go index c38d7425339..ae757ff61cf 100644 --- a/google/services/assuredworkloads/resource_assured_workloads_workload.go +++ b/google/services/assuredworkloads/resource_assured_workloads_workload.go @@ -955,7 +955,7 @@ func flattenAssuredWorkloadsWorkloadLabels(v map[string]string, d *schema.Resour transformed := make(map[string]interface{}) if l, ok := d.Get("labels").(map[string]interface{}); ok { - for k, _ := range l { + for k := range l { transformed[k] = v[k] } } @@ -970,7 +970,7 @@ func flattenAssuredWorkloadsWorkloadTerraformLabels(v map[string]string, d *sche transformed := make(map[string]interface{}) if l, ok := d.Get("terraform_labels").(map[string]interface{}); ok { - for k, _ := range l { + for k := range l { transformed[k] = v[k] } } diff --git a/google/services/bigtable/resource_bigtable_authorized_view_internal_test.go b/google/services/bigtable/resource_bigtable_authorized_view_internal_test.go index 59a88516327..b3253798beb 100644 --- a/google/services/bigtable/resource_bigtable_authorized_view_internal_test.go +++ b/google/services/bigtable/resource_bigtable_authorized_view_internal_test.go @@ -20,7 +20,7 @@ func TestUnitBigtable_flattenSubsetViewInfo(t *testing.T) { "empty subset view": { sv: bigtable.SubsetViewInfo{}, want: []map[string]interface{}{ - map[string]interface{}{}, + {}, }, orWant: nil, }, @@ -29,7 +29,7 @@ func TestUnitBigtable_flattenSubsetViewInfo(t *testing.T) { RowPrefixes: [][]byte{[]byte("row1"), []byte("row2")}, }, want: []map[string]interface{}{ - map[string]interface{}{ + { "row_prefixes": []string{"cm93MQ==", "cm93Mg=="}, }, }, @@ -47,12 +47,12 @@ func TestUnitBigtable_flattenSubsetViewInfo(t *testing.T) { }, }, want: []map[string]interface{}{ - map[string]interface{}{ + { "family_subsets": []map[string]interface{}{ - map[string]interface{}{ + { "family_name": "fam1", "qualifier_prefixes": []string{"Y29s"}, - }, map[string]interface{}{ + }, { "family_name": "fam2", "qualifiers": []string{"Y29sMQ==", "Y29sMg=="}, }, @@ -60,13 +60,13 @@ func TestUnitBigtable_flattenSubsetViewInfo(t *testing.T) { }, }, orWant: []map[string]interface{}{ - map[string]interface{}{ + { "family_subsets": []map[string]interface{}{ - map[string]interface{}{ + { "family_name": "fam2", "qualifiers": []string{"Y29sMQ==", "Y29sMg=="}, }, - map[string]interface{}{ + { "family_name": "fam1", "qualifier_prefixes": []string{"Y29s"}, }, @@ -83,9 +83,9 @@ func TestUnitBigtable_flattenSubsetViewInfo(t *testing.T) { }, }, want: []map[string]interface{}{ - map[string]interface{}{ + { "family_subsets": []map[string]interface{}{ - map[string]interface{}{ + { "family_name": "fam", "qualifiers": []string{"Y29s"}, }, @@ -103,9 +103,9 @@ func TestUnitBigtable_flattenSubsetViewInfo(t *testing.T) { }, }, want: []map[string]interface{}{ - map[string]interface{}{ + { "family_subsets": []map[string]interface{}{ - map[string]interface{}{ + { "family_name": "fam", "qualifier_prefixes": []string{"Y29s"}, }, @@ -120,7 +120,7 @@ func TestUnitBigtable_flattenSubsetViewInfo(t *testing.T) { FamilySubsets: map[string]bigtable.FamilySubset{}, }, want: []map[string]interface{}{ - map[string]interface{}{}, + {}, }, orWant: nil, }, diff --git a/google/services/bigtable/resource_bigtable_gc_policy.go b/google/services/bigtable/resource_bigtable_gc_policy.go index 3ae29ca4eb6..0925ec9f5d4 100644 --- a/google/services/bigtable/resource_bigtable_gc_policy.go +++ b/google/services/bigtable/resource_bigtable_gc_policy.go @@ -404,7 +404,6 @@ func GcPolicyToGCRuleString(gc bigtable.GCPolicy, topLevel bool) (map[string]int } else { result["max_version"] = version } - break case bigtable.PolicyUnion: result["mode"] = "union" rules := []interface{}{} @@ -416,7 +415,6 @@ func GcPolicyToGCRuleString(gc bigtable.GCPolicy, topLevel bool) (map[string]int rules = append(rules, gcRuleString) } result["rules"] = rules - break case bigtable.PolicyIntersection: result["mode"] = "intersection" rules := []interface{}{} diff --git a/google/services/bigtable/resource_bigtable_instance_internal_test.go b/google/services/bigtable/resource_bigtable_instance_internal_test.go index 8c195c1486c..568bcb36570 100644 --- a/google/services/bigtable/resource_bigtable_instance_internal_test.go +++ b/google/services/bigtable/resource_bigtable_instance_internal_test.go @@ -162,7 +162,7 @@ func TestUnitBigtable_flattenBigtableCluster(t *testing.T) { "kms_key_name": "KMS", "state": "CREATING", "autoscaling_config": []map[string]interface{}{ - map[string]interface{}{ + { "min_nodes": 3, "max_nodes": 7, "cpu_target": 50, diff --git a/google/services/bigtable/resource_bigtable_table.go b/google/services/bigtable/resource_bigtable_table.go index 18501c541a1..01ce669f6e8 100644 --- a/google/services/bigtable/resource_bigtable_table.go +++ b/google/services/bigtable/resource_bigtable_table.go @@ -459,7 +459,7 @@ func resourceBigtableTableUpdate(d *schema.ResourceData, meta interface{}) error return fmt.Errorf("Error creating column family %q: %s", cfn, err) } } - for cfn, _ := range familyMapDiffKeys(oMap, nMap) { + for cfn := range familyMapDiffKeys(oMap, nMap) { log.Printf("[DEBUG] removing column family %q", cfn) if err := c.DeleteColumnFamily(ctx, name, cfn); err != nil { return fmt.Errorf("Error deleting column family %q: %s", cfn, err) diff --git a/google/services/cloudbuild/resource_cloudbuild_worker_pool.go b/google/services/cloudbuild/resource_cloudbuild_worker_pool.go index 5e07f428bc3..60a373b3847 100644 --- a/google/services/cloudbuild/resource_cloudbuild_worker_pool.go +++ b/google/services/cloudbuild/resource_cloudbuild_worker_pool.go @@ -575,7 +575,7 @@ func flattenCloudbuildWorkerPoolAnnotations(v map[string]string, d *schema.Resou transformed := make(map[string]interface{}) if l, ok := d.Get("annotations").(map[string]interface{}); ok { - for k, _ := range l { + for k := range l { transformed[k] = v[k] } } diff --git a/google/services/clouddeploy/resource_clouddeploy_delivery_pipeline.go b/google/services/clouddeploy/resource_clouddeploy_delivery_pipeline.go index 015f49f1fb7..ac56b6492a3 100644 --- a/google/services/clouddeploy/resource_clouddeploy_delivery_pipeline.go +++ b/google/services/clouddeploy/resource_clouddeploy_delivery_pipeline.go @@ -1769,7 +1769,7 @@ func flattenClouddeployDeliveryPipelineLabels(v map[string]string, d *schema.Res transformed := make(map[string]interface{}) if l, ok := d.Get("labels").(map[string]interface{}); ok { - for k, _ := range l { + for k := range l { transformed[k] = v[k] } } @@ -1784,7 +1784,7 @@ func flattenClouddeployDeliveryPipelineTerraformLabels(v map[string]string, d *s transformed := make(map[string]interface{}) if l, ok := d.Get("terraform_labels").(map[string]interface{}); ok { - for k, _ := range l { + for k := range l { transformed[k] = v[k] } } @@ -1799,7 +1799,7 @@ func flattenClouddeployDeliveryPipelineAnnotations(v map[string]string, d *schem transformed := make(map[string]interface{}) if l, ok := d.Get("annotations").(map[string]interface{}); ok { - for k, _ := range l { + for k := range l { transformed[k] = v[k] } } diff --git a/google/services/clouddeploy/resource_clouddeploy_target.go b/google/services/clouddeploy/resource_clouddeploy_target.go index 1c08b873c34..61350b952e7 100644 --- a/google/services/clouddeploy/resource_clouddeploy_target.go +++ b/google/services/clouddeploy/resource_clouddeploy_target.go @@ -1106,7 +1106,7 @@ func flattenClouddeployTargetLabels(v map[string]string, d *schema.ResourceData) transformed := make(map[string]interface{}) if l, ok := d.Get("labels").(map[string]interface{}); ok { - for k, _ := range l { + for k := range l { transformed[k] = v[k] } } @@ -1121,7 +1121,7 @@ func flattenClouddeployTargetTerraformLabels(v map[string]string, d *schema.Reso transformed := make(map[string]interface{}) if l, ok := d.Get("terraform_labels").(map[string]interface{}); ok { - for k, _ := range l { + for k := range l { transformed[k] = v[k] } } @@ -1136,7 +1136,7 @@ func flattenClouddeployTargetAnnotations(v map[string]string, d *schema.Resource transformed := make(map[string]interface{}) if l, ok := d.Get("annotations").(map[string]interface{}); ok { - for k, _ := range l { + for k := range l { transformed[k] = v[k] } } diff --git a/google/services/container/node_config.go b/google/services/container/node_config.go index 1fd947df654..90d955873fd 100644 --- a/google/services/container/node_config.go +++ b/google/services/container/node_config.go @@ -1505,10 +1505,8 @@ func flattenResourceManagerTags(c *container.ResourceManagerTags) map[string]int rmt := make(map[string]interface{}) - if c != nil { - for k, v := range c.Tags { - rmt[k] = v - } + for k, v := range c.Tags { + rmt[k] = v } return rmt diff --git a/google/services/containeraws/resource_container_aws_cluster.go b/google/services/containeraws/resource_container_aws_cluster.go index e23f7a81767..2d3a891e0cc 100644 --- a/google/services/containeraws/resource_container_aws_cluster.go +++ b/google/services/containeraws/resource_container_aws_cluster.go @@ -1385,7 +1385,7 @@ func flattenContainerAwsClusterAnnotations(v map[string]string, d *schema.Resour transformed := make(map[string]interface{}) if l, ok := d.Get("annotations").(map[string]interface{}); ok { - for k, _ := range l { + for k := range l { transformed[k] = v[k] } } diff --git a/google/services/containeraws/resource_container_aws_node_pool.go b/google/services/containeraws/resource_container_aws_node_pool.go index 1203d3a4ff1..0458f7b6e9e 100644 --- a/google/services/containeraws/resource_container_aws_node_pool.go +++ b/google/services/containeraws/resource_container_aws_node_pool.go @@ -1252,7 +1252,7 @@ func flattenContainerAwsNodePoolAnnotations(v map[string]string, d *schema.Resou transformed := make(map[string]interface{}) if l, ok := d.Get("annotations").(map[string]interface{}); ok { - for k, _ := range l { + for k := range l { transformed[k] = v[k] } } diff --git a/google/services/containerazure/resource_container_azure_cluster.go b/google/services/containerazure/resource_container_azure_cluster.go index 749350e0564..bed37aeacb7 100644 --- a/google/services/containerazure/resource_container_azure_cluster.go +++ b/google/services/containerazure/resource_container_azure_cluster.go @@ -1310,7 +1310,7 @@ func flattenContainerAzureClusterAnnotations(v map[string]string, d *schema.Reso transformed := make(map[string]interface{}) if l, ok := d.Get("annotations").(map[string]interface{}); ok { - for k, _ := range l { + for k := range l { transformed[k] = v[k] } } diff --git a/google/services/containerazure/resource_container_azure_node_pool.go b/google/services/containerazure/resource_container_azure_node_pool.go index b8b01952598..fefee08f332 100644 --- a/google/services/containerazure/resource_container_azure_node_pool.go +++ b/google/services/containerazure/resource_container_azure_node_pool.go @@ -830,7 +830,7 @@ func flattenContainerAzureNodePoolAnnotations(v map[string]string, d *schema.Res transformed := make(map[string]interface{}) if l, ok := d.Get("annotations").(map[string]interface{}); ok { - for k, _ := range l { + for k := range l { transformed[k] = v[k] } } diff --git a/google/services/dataplex/resource_dataplex_asset.go b/google/services/dataplex/resource_dataplex_asset.go index e315cbdee24..e58bdacc4f4 100644 --- a/google/services/dataplex/resource_dataplex_asset.go +++ b/google/services/dataplex/resource_dataplex_asset.go @@ -904,7 +904,7 @@ func flattenDataplexAssetLabels(v map[string]string, d *schema.ResourceData) int transformed := make(map[string]interface{}) if l, ok := d.Get("labels").(map[string]interface{}); ok { - for k, _ := range l { + for k := range l { transformed[k] = v[k] } } @@ -919,7 +919,7 @@ func flattenDataplexAssetTerraformLabels(v map[string]string, d *schema.Resource transformed := make(map[string]interface{}) if l, ok := d.Get("terraform_labels").(map[string]interface{}); ok { - for k, _ := range l { + for k := range l { transformed[k] = v[k] } } diff --git a/google/services/dataplex/resource_dataplex_lake.go b/google/services/dataplex/resource_dataplex_lake.go index 4f09adda808..556b0221de6 100644 --- a/google/services/dataplex/resource_dataplex_lake.go +++ b/google/services/dataplex/resource_dataplex_lake.go @@ -550,7 +550,7 @@ func flattenDataplexLakeLabels(v map[string]string, d *schema.ResourceData) inte transformed := make(map[string]interface{}) if l, ok := d.Get("labels").(map[string]interface{}); ok { - for k, _ := range l { + for k := range l { transformed[k] = v[k] } } @@ -565,7 +565,7 @@ func flattenDataplexLakeTerraformLabels(v map[string]string, d *schema.ResourceD transformed := make(map[string]interface{}) if l, ok := d.Get("terraform_labels").(map[string]interface{}); ok { - for k, _ := range l { + for k := range l { transformed[k] = v[k] } } diff --git a/google/services/dataplex/resource_dataplex_zone.go b/google/services/dataplex/resource_dataplex_zone.go index e3e4b6c6d74..839da21f2f5 100644 --- a/google/services/dataplex/resource_dataplex_zone.go +++ b/google/services/dataplex/resource_dataplex_zone.go @@ -726,7 +726,7 @@ func flattenDataplexZoneLabels(v map[string]string, d *schema.ResourceData) inte transformed := make(map[string]interface{}) if l, ok := d.Get("labels").(map[string]interface{}); ok { - for k, _ := range l { + for k := range l { transformed[k] = v[k] } } @@ -741,7 +741,7 @@ func flattenDataplexZoneTerraformLabels(v map[string]string, d *schema.ResourceD transformed := make(map[string]interface{}) if l, ok := d.Get("terraform_labels").(map[string]interface{}); ok { - for k, _ := range l { + for k := range l { transformed[k] = v[k] } } diff --git a/google/services/dataproc/resource_dataproc_workflow_template.go b/google/services/dataproc/resource_dataproc_workflow_template.go index d99577891ed..c52a92412d6 100644 --- a/google/services/dataproc/resource_dataproc_workflow_template.go +++ b/google/services/dataproc/resource_dataproc_workflow_template.go @@ -4128,7 +4128,7 @@ func flattenDataprocWorkflowTemplateLabels(v map[string]string, d *schema.Resour transformed := make(map[string]interface{}) if l, ok := d.Get("labels").(map[string]interface{}); ok { - for k, _ := range l { + for k := range l { transformed[k] = v[k] } } @@ -4143,7 +4143,7 @@ func flattenDataprocWorkflowTemplateTerraformLabels(v map[string]string, d *sche transformed := make(map[string]interface{}) if l, ok := d.Get("terraform_labels").(map[string]interface{}); ok { - for k, _ := range l { + for k := range l { transformed[k] = v[k] } } diff --git a/google/services/eventarc/resource_eventarc_trigger.go b/google/services/eventarc/resource_eventarc_trigger.go index b0cfc620ae4..694ff50ba24 100644 --- a/google/services/eventarc/resource_eventarc_trigger.go +++ b/google/services/eventarc/resource_eventarc_trigger.go @@ -922,7 +922,7 @@ func flattenEventarcTriggerLabels(v map[string]string, d *schema.ResourceData) i transformed := make(map[string]interface{}) if l, ok := d.Get("labels").(map[string]interface{}); ok { - for k, _ := range l { + for k := range l { transformed[k] = v[k] } } @@ -937,7 +937,7 @@ func flattenEventarcTriggerTerraformLabels(v map[string]string, d *schema.Resour transformed := make(map[string]interface{}) if l, ok := d.Get("terraform_labels").(map[string]interface{}); ok { - for k, _ := range l { + for k := range l { transformed[k] = v[k] } } diff --git a/google/services/netapp/resource_netapp_volume_test.go b/google/services/netapp/resource_netapp_volume_test.go index d845c58fd89..9798d19bbfb 100644 --- a/google/services/netapp/resource_netapp_volume_test.go +++ b/google/services/netapp/resource_netapp_volume_test.go @@ -620,7 +620,7 @@ func testAccNetappVolume_volumeBasicExample_cleanupScheduledBackup(t *testing.T, createTime time.Time } var backupDataList []BackupData - for i, _ := range backups { + for i := range backups { backup := backups[i].(map[string]interface{}) backupName := backup["name"].(string) backupCreateTimeStr := backup["createTime"].(string) @@ -637,7 +637,7 @@ func testAccNetappVolume_volumeBasicExample_cleanupScheduledBackup(t *testing.T, sort.Slice(backupDataList, func(i, j int) bool { return backupDataList[i].createTime.After(backupDataList[j].createTime) }) - for i, _ := range backupDataList { + for i := range backupDataList { baseUrl, err := tpgresource.ReplaceVarsForTest(config, rs, "{{NetappBasePath}}") if err != nil { return fmt.Errorf("Error : %v", err) diff --git a/google/services/recaptchaenterprise/resource_recaptcha_enterprise_key.go b/google/services/recaptchaenterprise/resource_recaptcha_enterprise_key.go index 96e7e215b3a..dbcca013828 100644 --- a/google/services/recaptchaenterprise/resource_recaptcha_enterprise_key.go +++ b/google/services/recaptchaenterprise/resource_recaptcha_enterprise_key.go @@ -684,7 +684,7 @@ func flattenRecaptchaEnterpriseKeyLabels(v map[string]string, d *schema.Resource transformed := make(map[string]interface{}) if l, ok := d.Get("labels").(map[string]interface{}); ok { - for k, _ := range l { + for k := range l { transformed[k] = v[k] } } @@ -699,7 +699,7 @@ func flattenRecaptchaEnterpriseKeyTerraformLabels(v map[string]string, d *schema transformed := make(map[string]interface{}) if l, ok := d.Get("terraform_labels").(map[string]interface{}); ok { - for k, _ := range l { + for k := range l { transformed[k] = v[k] } } diff --git a/google/services/tags/resource_tags_location_tag_bindings.go b/google/services/tags/resource_tags_location_tag_bindings.go index 9995b8e1734..4334367a74d 100644 --- a/google/services/tags/resource_tags_location_tag_bindings.go +++ b/google/services/tags/resource_tags_location_tag_bindings.go @@ -354,7 +354,6 @@ func flattenNestedTagsLocationTagBinding(d *schema.ResourceData, meta interface{ switch v.(type) { case []interface{}: log.Printf("[DEBUG] Hey it's in break = %#v,)", v) - break case map[string]interface{}: // Construct list out of single nested resource v = []interface{}{v}