From 74865a311be8572a8481e6bac277d4a19d51dc6a Mon Sep 17 00:00:00 2001 From: Artur Sawicki Date: Tue, 12 Dec 2023 13:50:04 +0100 Subject: [PATCH] Fix linter complaints --- pkg/helpers/helpers.go | 10 +++++----- .../TestAcc_ExternalTable_basic/test.tf | 20 +++++++++---------- pkg/sdk/privileges.go | 12 +++++------ 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/pkg/helpers/helpers.go b/pkg/helpers/helpers.go index 806fa760916..b0a121770e7 100644 --- a/pkg/helpers/helpers.go +++ b/pkg/helpers/helpers.go @@ -66,15 +66,15 @@ func EncodeSnowflakeID(attributes ...interface{}) string { if len(attributes) == 1 { if id, ok := attributes[0].(sdk.ObjectIdentifier); ok { parts := make([]string, 0) - switch id.(type) { + switch v := id.(type) { case sdk.AccountObjectIdentifier: - parts = append(parts, id.(sdk.AccountObjectIdentifier).Name()) + parts = append(parts, v.Name()) case sdk.DatabaseObjectIdentifier: - parts = append(parts, id.(sdk.DatabaseObjectIdentifier).DatabaseName(), id.(sdk.DatabaseObjectIdentifier).Name()) + parts = append(parts, v.DatabaseName(), v.Name()) case sdk.SchemaObjectIdentifier: - parts = append(parts, id.(sdk.SchemaObjectIdentifier).DatabaseName(), id.(sdk.SchemaObjectIdentifier).SchemaName(), id.(sdk.SchemaObjectIdentifier).Name()) + parts = append(parts, v.DatabaseName(), v.SchemaName(), v.Name()) case sdk.TableColumnIdentifier: - parts = append(parts, id.(sdk.TableColumnIdentifier).DatabaseName(), id.(sdk.TableColumnIdentifier).SchemaName(), id.(sdk.TableColumnIdentifier).TableName(), id.(sdk.TableColumnIdentifier).Name()) + parts = append(parts, v.DatabaseName(), v.SchemaName(), v.TableName(), v.Name()) default: log.Panicf("Unsupported object identifier: %v", id) } diff --git a/pkg/resources/testdata/TestAcc_ExternalTable_basic/test.tf b/pkg/resources/testdata/TestAcc_ExternalTable_basic/test.tf index aab230558fc..c8efacb28f4 100644 --- a/pkg/resources/testdata/TestAcc_ExternalTable_basic/test.tf +++ b/pkg/resources/testdata/TestAcc_ExternalTable_basic/test.tf @@ -1,22 +1,22 @@ resource "snowflake_storage_integration" "i" { - name = var.name + name = var.name storage_allowed_locations = [var.location] - storage_provider = "S3" - storage_aws_role_arn = var.aws_arn + storage_provider = "S3" + storage_aws_role_arn = var.aws_arn } resource "snowflake_stage" "test" { - name = var.name - url = var.location - database = var.database - schema = var.schema + name = var.name + url = var.location + database = var.database + schema = var.schema storage_integration = snowflake_storage_integration.i.name } resource "snowflake_external_table" "test_table" { - name = var.name + name = var.name database = var.database - schema = var.schema + schema = var.schema comment = "Terraform acceptance test" column { name = "column1" @@ -29,5 +29,5 @@ resource "snowflake_external_table" "test_table" { as = "($1:\"CreatedDate\"::timestamp)" } file_format = "TYPE = CSV" - location = "@\"${var.database}\".\"${var.schema}\".\"${snowflake_stage.test.name}\"" + location = "@\"${var.database}\".\"${var.schema}\".\"${snowflake_stage.test.name}\"" } diff --git a/pkg/sdk/privileges.go b/pkg/sdk/privileges.go index 47bb95a5205..51b24cedf59 100644 --- a/pkg/sdk/privileges.go +++ b/pkg/sdk/privileges.go @@ -186,12 +186,12 @@ const ( // -- For ICEBERG TABLE SchemaObjectPrivilegeApplyBudget SchemaObjectPrivilege = "APPLYBUDGET" - //SchemaObjectPrivilegeDelete SchemaObjectPrivilege = "DELETE" (duplicate) - //SchemaObjectPrivilegeInsert SchemaObjectPrivilege = "INSERT" (duplicate) - //SchemaObjectPrivilegeReferences SchemaObjectPrivilege = "REFERENCES" (duplicate) - //SchemaObjectPrivilegeSelect SchemaObjectPrivilege = "SELECT" (duplicate) - //SchemaObjectPrivilegeTruncate SchemaObjectPrivilege = "Truncate" (duplicate) - //SchemaObjectPrivilegeUpdate SchemaObjectPrivilege = "Update" (duplicate) + // SchemaObjectPrivilegeDelete SchemaObjectPrivilege = "DELETE" (duplicate) + // SchemaObjectPrivilegeInsert SchemaObjectPrivilege = "INSERT" (duplicate) + // SchemaObjectPrivilegeReferences SchemaObjectPrivilege = "REFERENCES" (duplicate) + // SchemaObjectPrivilegeSelect SchemaObjectPrivilege = "SELECT" (duplicate) + // SchemaObjectPrivilegeTruncate SchemaObjectPrivilege = "Truncate" (duplicate) + // SchemaObjectPrivilegeUpdate SchemaObjectPrivilege = "Update" (duplicate) // -- For PIPE // { MONITOR | OPERATE } [ , ... ]