From fb4a680b277c0c95715100c9ae2a43ababc1b215 Mon Sep 17 00:00:00 2001 From: Serge Smertin Date: Mon, 15 Jun 2020 00:40:23 +0200 Subject: [PATCH] go-fmt cleanup --- databricks/mounts_test.go | 24 ++++----- ...source_databricks_azure_adls_gen1_mount.go | 2 +- ...source_databricks_azure_adls_gen2_mount.go | 8 +-- .../resource_databricks_azure_blob_mount.go | 2 +- .../resource_databricks_job_aws_test.go | 52 +++++++++---------- .../resource_databricks_job_azure_test.go | 34 ++++++------ 6 files changed, 61 insertions(+), 61 deletions(-) diff --git a/databricks/mounts_test.go b/databricks/mounts_test.go index ac6c2d7f0..a8dd4f7eb 100644 --- a/databricks/mounts_test.go +++ b/databricks/mounts_test.go @@ -8,16 +8,16 @@ import ( func TestValidateMountDirectory(t *testing.T) { testCases := []struct { - directory string - errorCount int - }{ - {"", 0}, - {"/directory", 0}, - {"directory", 1}, - } - for _, tc := range testCases { - _, errs := ValidateMountDirectory(tc.directory, "key") - - assert.Lenf(t, errs, tc.errorCount, "directory '%s' does not generate the expected error count", tc.directory) - } + directory string + errorCount int + }{ + {"", 0}, + {"/directory", 0}, + {"directory", 1}, + } + for _, tc := range testCases { + _, errs := ValidateMountDirectory(tc.directory, "key") + + assert.Lenf(t, errs, tc.errorCount, "directory '%s' does not generate the expected error count", tc.directory) + } } diff --git a/databricks/resource_databricks_azure_adls_gen1_mount.go b/databricks/resource_databricks_azure_adls_gen1_mount.go index 4d6d28bd6..ee798a46f 100644 --- a/databricks/resource_databricks_azure_adls_gen1_mount.go +++ b/databricks/resource_databricks_azure_adls_gen1_mount.go @@ -39,7 +39,7 @@ func resourceAzureAdlsGen1Mount() *schema.Resource { Optional: true, Computed: true, //Default: "/", - ForceNew: true, + ForceNew: true, ValidateFunc: ValidateMountDirectory, }, "mount_name": { diff --git a/databricks/resource_databricks_azure_adls_gen2_mount.go b/databricks/resource_databricks_azure_adls_gen2_mount.go index 36388f7e7..4991dc836 100644 --- a/databricks/resource_databricks_azure_adls_gen2_mount.go +++ b/databricks/resource_databricks_azure_adls_gen2_mount.go @@ -32,10 +32,10 @@ func resourceAzureAdlsGen2Mount() *schema.Resource { ForceNew: true, }, "directory": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, ValidateFunc: ValidateMountDirectory, }, "mount_name": { diff --git a/databricks/resource_databricks_azure_blob_mount.go b/databricks/resource_databricks_azure_blob_mount.go index d9b6e9ba7..ac4143390 100644 --- a/databricks/resource_databricks_azure_blob_mount.go +++ b/databricks/resource_databricks_azure_blob_mount.go @@ -37,7 +37,7 @@ func resourceAzureBlobMount() *schema.Resource { Optional: true, Computed: true, //Default: "/", - ForceNew: true, + ForceNew: true, ValidateFunc: ValidateMountDirectory, }, "mount_name": { diff --git a/databricks/resource_databricks_job_aws_test.go b/databricks/resource_databricks_job_aws_test.go index 972e08cea..e423ed498 100644 --- a/databricks/resource_databricks_job_aws_test.go +++ b/databricks/resource_databricks_job_aws_test.go @@ -114,30 +114,30 @@ func testAwsJobValuesNewCluster(t *testing.T, job *model.Job) resource.TestCheck } func testAwsJobResourceNewCluster() string { - return fmt.Sprintf(` - resource "databricks_job" "my_job" { - new_cluster { - autoscale { - min_workers = 2 - max_workers = 3 - } - spark_version = "6.4.x-scala2.11" - aws_attributes { - availability = "SPOT" - zone_id = "us-east-1a" - spot_bid_price_percent = "100" - first_on_demand = 1 - ebs_volume_type = "GENERAL_PURPOSE_SSD" - ebs_volume_count = 1 - ebs_volume_size = 32 - } - node_type_id = "r3.xlarge" - } - notebook_path = "/Users/jane.doe@databricks.com/my-demo-notebook" - name = "my-demo-notebook" - timeout_seconds = 3600 - max_retries = 1 - max_concurrent_runs = 1 - } - `) + return ` + resource "databricks_job" "my_job" { + new_cluster { + autoscale { + min_workers = 2 + max_workers = 3 + } + spark_version = "6.4.x-scala2.11" + aws_attributes { + availability = "SPOT" + zone_id = "us-east-1a" + spot_bid_price_percent = "100" + first_on_demand = 1 + ebs_volume_type = "GENERAL_PURPOSE_SSD" + ebs_volume_count = 1 + ebs_volume_size = 32 + } + node_type_id = "r3.xlarge" + } + notebook_path = "/Users/jane.doe@databricks.com/my-demo-notebook" + name = "my-demo-notebook" + timeout_seconds = 3600 + max_retries = 1 + max_concurrent_runs = 1 + } + ` } diff --git a/databricks/resource_databricks_job_azure_test.go b/databricks/resource_databricks_job_azure_test.go index 2abab1ec0..58712e442 100644 --- a/databricks/resource_databricks_job_azure_test.go +++ b/databricks/resource_databricks_job_azure_test.go @@ -106,21 +106,21 @@ func testAzureJobValuesNewCluster(t *testing.T, job *model.Job) resource.TestChe } func testAzureJobResourceNewCluster() string { - return fmt.Sprintf(` - resource "databricks_job" "my_job" { - new_cluster { - autoscale { - min_workers = 2 - max_workers = 3 - } - spark_version = "6.4.x-scala2.11" - node_type_id = "Standard_DS3_v2" - } - notebook_path = "/Users/jane.doe@databricks.com/my-demo-notebook" - name = "my-demo-notebook" - timeout_seconds = 3600 - max_retries = 1 - max_concurrent_runs = 1 - } - `) + return ` + resource "databricks_job" "my_job" { + new_cluster { + autoscale { + min_workers = 2 + max_workers = 3 + } + spark_version = "6.4.x-scala2.11" + node_type_id = "Standard_DS3_v2" + } + notebook_path = "/Users/jane.doe@databricks.com/my-demo-notebook" + name = "my-demo-notebook" + timeout_seconds = 3600 + max_retries = 1 + max_concurrent_runs = 1 + } + ` }