diff --git a/pkg/datasources/current_account.go b/pkg/datasources/current_account.go index 1d74225df1..3408778462 100644 --- a/pkg/datasources/current_account.go +++ b/pkg/datasources/current_account.go @@ -43,7 +43,7 @@ func ReadCurrentAccount(d *schema.ResourceData, meta interface{}) error { acc, err := snowflake.ReadCurrentAccount(db) if err != nil { - log.Printf("[DEBUG] current_account failed to decode") + log.Println("[DEBUG] current_account failed to decode") d.SetId("") return nil } @@ -60,7 +60,7 @@ func ReadCurrentAccount(d *schema.ResourceData, meta interface{}) error { url, err := acc.AccountURL() if err != nil { - log.Printf("[DEBUG] generating snowflake url failed") + log.Println("[DEBUG] generating snowflake url failed") d.SetId("") return nil } diff --git a/pkg/datasources/database.go b/pkg/datasources/database.go index 7b765a7fb7..6650c0f874 100644 --- a/pkg/datasources/database.go +++ b/pkg/datasources/database.go @@ -65,12 +65,12 @@ func ReadDatabase(d *schema.ResourceData, meta interface{}) error { log.Printf("[DEBUG] database: %v", d.Get("name")) dbData, err := snowflake.ListDatabase(dbx, d.Get("name").(string)) if err != nil { - log.Printf("[DEBUG] list database failed to decode") + log.Println("[DEBUG] list database failed to decode") d.SetId("") return nil } if dbData == nil || !dbData.DBName.Valid { - log.Printf("[DEBUG] database not found") + log.Println("[DEBUG] database not found") d.SetId("") return nil } diff --git a/pkg/datasources/databases.go b/pkg/datasources/databases.go index 1e1806ac1d..d61e95e6cf 100644 --- a/pkg/datasources/databases.go +++ b/pkg/datasources/databases.go @@ -89,7 +89,7 @@ func ReadDatabases(d *schema.ResourceData, meta interface{}) error { dbx := sqlx.NewDb(db, "snowflake") dbs, err := snowflake.ListDatabases(dbx) if err != nil { - log.Printf("[DEBUG] list databases failed to decode") + log.Println("[DEBUG] list databases failed to decode") d.SetId("") return nil } diff --git a/pkg/datasources/system_get_privatelink_config.go b/pkg/datasources/system_get_privatelink_config.go index fcc7ed4fda..df9e6f2ac1 100644 --- a/pkg/datasources/system_get_privatelink_config.go +++ b/pkg/datasources/system_get_privatelink_config.go @@ -57,14 +57,14 @@ func ReadSystemGetPrivateLinkConfig(d *schema.ResourceData, meta interface{}) er if err == sql.ErrNoRows { // If not found, mark resource to be removed from statefile during apply or refresh - log.Print("[DEBUG] system_get_privatelink_config not found") + log.Println("[DEBUG] system_get_privatelink_config not found") d.SetId("") return nil } config, err := rawConfig.GetStructuredConfig() if err != nil { - log.Printf("[DEBUG] system_get_privatelink_config failed to decode") + log.Println("[DEBUG] system_get_privatelink_config failed to decode") d.SetId("") return nil } diff --git a/pkg/datasources/system_get_snowflake_platform_info.go b/pkg/datasources/system_get_snowflake_platform_info.go index 64d3105ca6..d939249785 100644 --- a/pkg/datasources/system_get_snowflake_platform_info.go +++ b/pkg/datasources/system_get_snowflake_platform_info.go @@ -42,7 +42,7 @@ func ReadSystemGetSnowflakePlatformInfo(d *schema.ResourceData, meta interface{} if err != nil { // If not found, mark resource to be removed from statefile during apply or refresh d.SetId("") - log.Printf("[DEBUG] current_account failed to decode") + log.Println("[DEBUG] current_account failed to decode") return errors.Wrap(err, "error current_account") } @@ -51,13 +51,13 @@ func ReadSystemGetSnowflakePlatformInfo(d *schema.ResourceData, meta interface{} rawInfo, err := snowflake.ScanSnowflakePlatformInfo(row) if err == sql.ErrNoRows { // If not found, mark resource to be removed from statefile during apply or refresh - log.Print("[DEBUG] system_get_snowflake_platform_info not found") + log.Println("[DEBUG] system_get_snowflake_platform_info not found") return errors.Wrap(err, "error system_get_snowflake_platform_info") } info, err := rawInfo.GetStructuredConfig() if err != nil { - log.Printf("[DEBUG] system_get_snowflake_platform_info failed to decode") + log.Println("[DEBUG] system_get_snowflake_platform_info failed to decode") d.SetId("") return errors.Wrap(err, "error system_get_snowflake_platform_info") } diff --git a/pkg/resources/managed_account.go b/pkg/resources/managed_account.go index 858b9a8f69..42a8331510 100644 --- a/pkg/resources/managed_account.go +++ b/pkg/resources/managed_account.go @@ -114,7 +114,7 @@ func CreateManagedAccount(d *schema.ResourceData, meta interface{}) error { // some time to appear. This is currently implemented as a sleep. @TODO actually // wait until the locator is generated. func initialReadManagedAccount(d *schema.ResourceData, meta interface{}) error { - log.Printf("[INFO] sleeping to give the locator a chance to be generated") + log.Println("[INFO] sleeping to give the locator a chance to be generated") //lintignore:R018 time.Sleep(10 * time.Second) return ReadManagedAccount(d, meta) diff --git a/pkg/resources/resource.go b/pkg/resources/resource.go index 9f54cd2db3..8ad9788750 100644 --- a/pkg/resources/resource.go +++ b/pkg/resources/resource.go @@ -111,7 +111,7 @@ func UpdateResource( } if d.HasChange("tag") { - log.Printf("[DEBUG] updating tags") + log.Println("[DEBUG] updating tags") v := d.Get("tag") tags := getTags(v) qb.SetTags(tags.toSnowflakeTagValues()) @@ -122,7 +122,7 @@ func UpdateResource( return errors.Wrapf(err, "error altering %s", t) } } - log.Printf("[DEBUG] performing read") + log.Println("[DEBUG] performing read") return read(d, meta) } } diff --git a/pkg/resources/tag_association.go b/pkg/resources/tag_association.go index cb6cec558b..d15837eb6b 100644 --- a/pkg/resources/tag_association.go +++ b/pkg/resources/tag_association.go @@ -91,7 +91,7 @@ func CreateTagAssociation(d *schema.ResourceData, meta interface{}) error { skipValidate := d.Get("skip_validation").(bool) if !skipValidate { - log.Printf("[DEBUG] validating tag creation") + log.Println("[DEBUG] validating tag creation") err = resource.RetryContext(context.Background(), d.Timeout(schema.TimeoutCreate)-time.Minute, func() *resource.RetryError { @@ -135,7 +135,7 @@ func ReadTagAssociation(d *schema.ResourceData, meta interface{}) error { tagValue := d.Get("tag_value").(string) skipValidate := d.Get("skip_validation").(bool) if skipValidate { - log.Printf("[DEBUG] skipping read for tag association that has skip_validation enabled") + log.Println("[DEBUG] skipping read for tag association that has skip_validation enabled") return nil } diff --git a/pkg/snowflake/database.go b/pkg/snowflake/database.go index e32eac3b12..bc61062eac 100644 --- a/pkg/snowflake/database.go +++ b/pkg/snowflake/database.go @@ -280,7 +280,7 @@ func ListDatabases(sdb *sqlx.DB) ([]database, error) { dbs := []database{} err = sqlx.StructScan(rows, &dbs) if err == sql.ErrNoRows { - log.Printf("[DEBUG] no databases found") + log.Println("[DEBUG] no databases found") return nil, nil } return dbs, errors.Wrapf(err, "unable to scan row for %s", stmt) @@ -297,7 +297,7 @@ func ListDatabase(sdb *sqlx.DB, databaseName string) (*database, error) { dbs := []database{} err = sqlx.StructScan(rows, &dbs) if err == sql.ErrNoRows || len(dbs) == 0 { - log.Printf("[DEBUG] no databases found") + log.Println("[DEBUG] no databases found") return nil, nil } db := &database{} diff --git a/pkg/snowflake/external_function.go b/pkg/snowflake/external_function.go index ec8d0e0a27..bc5993c534 100644 --- a/pkg/snowflake/external_function.go +++ b/pkg/snowflake/external_function.go @@ -279,7 +279,7 @@ func ListExternalFunctions(databaseName string, schemaName string, db *sql.DB) ( dbs := []externalFunction{} err = sqlx.StructScan(rows, &dbs) if err == sql.ErrNoRows { - log.Printf("[DEBUG] no external functions found") + log.Println("[DEBUG] no external functions found") return nil, nil } return dbs, errors.Wrapf(err, "unable to scan row for %s", stmt) diff --git a/pkg/snowflake/external_table.go b/pkg/snowflake/external_table.go index 1f2bc9f0cc..73f0b9abb6 100644 --- a/pkg/snowflake/external_table.go +++ b/pkg/snowflake/external_table.go @@ -225,7 +225,7 @@ func ListExternalTables(databaseName string, schemaName string, db *sql.DB) ([]e dbs := []externalTable{} err = sqlx.StructScan(rows, &dbs) if err == sql.ErrNoRows { - log.Printf("[DEBUG] no external tables found") + log.Println("[DEBUG] no external tables found") return nil, nil } return dbs, errors.Wrapf(err, "unable to scan row for %s", stmt) diff --git a/pkg/snowflake/file_format.go b/pkg/snowflake/file_format.go index b9425e9ed6..750661d39d 100644 --- a/pkg/snowflake/file_format.go +++ b/pkg/snowflake/file_format.go @@ -628,7 +628,7 @@ func ListFileFormats(databaseName string, schemaName string, db *sql.DB) ([]file dbs := []fileFormatShow{} err = sqlx.StructScan(rows, &dbs) if err == sql.ErrNoRows { - log.Printf("[DEBUG] no file formats found") + log.Println("[DEBUG] no file formats found") return nil, nil } return dbs, errors.Wrapf(err, "unable to scan row for %s", stmt) diff --git a/pkg/snowflake/function.go b/pkg/snowflake/function.go index f3e699f568..4ba0749a09 100644 --- a/pkg/snowflake/function.go +++ b/pkg/snowflake/function.go @@ -342,7 +342,7 @@ func ListFunctions(databaseName string, schemaName string, db *sql.DB) ([]functi dbs := []function{} err = sqlx.StructScan(rows, &dbs) if err == sql.ErrNoRows { - log.Printf("[DEBUG] no functions found") + log.Println("[DEBUG] no functions found") return nil, nil } return dbs, pe.Wrapf(err, "unable to scan row for %s", stmt) diff --git a/pkg/snowflake/masking_policy.go b/pkg/snowflake/masking_policy.go index d8531f1be1..85416dd9f5 100644 --- a/pkg/snowflake/masking_policy.go +++ b/pkg/snowflake/masking_policy.go @@ -70,7 +70,7 @@ func (mpb *MaskingPolicyBuilder) WithReturnDataType(dataType string) *MaskingPol // // Supported DDL operations are: // - CREATE MASKING POLICY -// - ALTER MASKING POLICY +// - ALTER MASKING POLICY // - DROP MASKING POLICY // - SHOW MASKING POLICIES // - DESCRIBE MASKING POLICY @@ -160,7 +160,7 @@ func ListMaskingPolicies(databaseName string, schemaName string, db *sql.DB) ([] dbs := []MaskingPolicyStruct{} err = sqlx.StructScan(rows, &dbs) if err == sql.ErrNoRows { - log.Printf("[DEBUG] no masking policies found") + log.Println("[DEBUG] no masking policies found") return nil, nil } return dbs, errors.Wrapf(err, "unable to scan row for %s", stmt) diff --git a/pkg/snowflake/materialized_view.go b/pkg/snowflake/materialized_view.go index f44da75113..7b57ad6ead 100644 --- a/pkg/snowflake/materialized_view.go +++ b/pkg/snowflake/materialized_view.go @@ -227,7 +227,7 @@ func ListMaterializedViews(databaseName string, schemaName string, db *sql.DB) ( dbs := []materializedView{} err = sqlx.StructScan(rows, &dbs) if err == sql.ErrNoRows { - log.Printf("[DEBUG] no materialized views found") + log.Println("[DEBUG] no materialized views found") return nil, nil } return dbs, pe.Wrapf(err, "unable to scan row for %s", stmt) diff --git a/pkg/snowflake/pipe.go b/pkg/snowflake/pipe.go index a0ad2ae2c9..d25562b446 100644 --- a/pkg/snowflake/pipe.go +++ b/pkg/snowflake/pipe.go @@ -68,13 +68,13 @@ func (pb *PipeBuilder) WithCopyStatement(s string) *PipeBuilder { return pb } -/// WithIntegration adds Integration specification to the PipeBuilder +// / WithIntegration adds Integration specification to the PipeBuilder func (pb *PipeBuilder) WithIntegration(s string) *PipeBuilder { pb.integration = s return pb } -/// WithErrorIntegration adds ErrorIntegration specification to the PipeBuilder +// / WithErrorIntegration adds ErrorIntegration specification to the PipeBuilder func (pb *PipeBuilder) WithErrorIntegration(s string) *PipeBuilder { pb.errorIntegration = s return pb @@ -190,7 +190,7 @@ func ListPipes(databaseName string, schemaName string, db *sql.DB) ([]pipe, erro dbs := []pipe{} err = sqlx.StructScan(rows, &dbs) if err == sql.ErrNoRows { - log.Printf("[DEBUG] no pipes found") + log.Println("[DEBUG] no pipes found") return nil, nil } return dbs, errors.Wrapf(err, "unable to scan row for %s", stmt) diff --git a/pkg/snowflake/procedure.go b/pkg/snowflake/procedure.go index deb72b18ee..3b9f4e0feb 100644 --- a/pkg/snowflake/procedure.go +++ b/pkg/snowflake/procedure.go @@ -289,7 +289,7 @@ func ListProcedures(databaseName string, schemaName string, db *sql.DB) ([]proce dbs := []procedure{} err = sqlx.StructScan(rows, &dbs) if err == sql.ErrNoRows { - log.Printf("[DEBUG] no procedures found") + log.Println("[DEBUG] no procedures found") return nil, nil } return dbs, pe.Wrapf(err, "unable to scan row for %s", stmt) diff --git a/pkg/snowflake/resource_monitor.go b/pkg/snowflake/resource_monitor.go index e9090b84d3..c0b430a51c 100644 --- a/pkg/snowflake/resource_monitor.go +++ b/pkg/snowflake/resource_monitor.go @@ -163,7 +163,7 @@ func ListResourceMonitors(db *sql.DB) ([]resourceMonitor, error) { dbs := []resourceMonitor{} err = sqlx.StructScan(rows, &dbs) if err == sql.ErrNoRows { - log.Printf("[DEBUG] no resouce monitors found") + log.Println("[DEBUG] no resouce monitors found") return nil, nil } return dbs, errors.Wrapf(err, "unable to scan row for %s", stmt) diff --git a/pkg/snowflake/row_access_policy.go b/pkg/snowflake/row_access_policy.go index 30dada79db..22dd6e749d 100644 --- a/pkg/snowflake/row_access_policy.go +++ b/pkg/snowflake/row_access_policy.go @@ -63,11 +63,10 @@ func (rapb *RowAccessPolicyBuilder) WithRowAccessExpression(rowAccessExpression // // Supported DDL operations are: // - CREATE ROW ACCESS POLICY -// - ALTER ROW ACCESS POLICY +// - ALTER ROW ACCESS POLICY // - DROP ROW ACCESS POLICY // - SHOW ROW ACCESS POLICIES // - DESCRIBE ROW ACCESS POLICY -// func RowAccessPolicy(name, db, schema string) *RowAccessPolicyBuilder { return &RowAccessPolicyBuilder{ name: name, @@ -159,7 +158,7 @@ func ListRowAccessPolicies(databaseName string, schemaName string, db *sql.DB) ( dbs := []RowAccessPolicyStruct{} err = sqlx.StructScan(rows, &dbs) if err == sql.ErrNoRows { - log.Printf("[DEBUG] no row access policies found") + log.Println("[DEBUG] no row access policies found") return nil, nil } return dbs, pe.Wrapf(err, "unable to scan row for %s", stmt) diff --git a/pkg/snowflake/schema.go b/pkg/snowflake/schema.go index bad87d0c81..2e4d1a01db 100644 --- a/pkg/snowflake/schema.go +++ b/pkg/snowflake/schema.go @@ -229,7 +229,7 @@ func ListSchemas(databaseName string, db *sql.DB) ([]schema, error) { dbs := []schema{} err = sqlx.StructScan(rows, &dbs) if err == sql.ErrNoRows { - log.Printf("[DEBUG] no schemas found") + log.Println("[DEBUG] no schemas found") return nil, nil } return dbs, errors.Wrapf(err, "unable to scan row for %s", stmt) diff --git a/pkg/snowflake/sequence.go b/pkg/snowflake/sequence.go index b7f0173e1c..48d6863e3e 100644 --- a/pkg/snowflake/sequence.go +++ b/pkg/snowflake/sequence.go @@ -106,7 +106,7 @@ func ListSequences(databaseName string, schemaName string, db *sql.DB) ([]sequen dbs := []sequence{} err = sqlx.StructScan(rows, &dbs) if err == sql.ErrNoRows { - log.Printf("[DEBUG] no sequences found") + log.Println("[DEBUG] no sequences found") return nil, nil } return dbs, errors.Wrapf(err, "unable to scan row for %s", stmt) diff --git a/pkg/snowflake/stage.go b/pkg/snowflake/stage.go index 21eb15e802..8be70ac910 100644 --- a/pkg/snowflake/stage.go +++ b/pkg/snowflake/stage.go @@ -323,7 +323,7 @@ func ListStages(databaseName string, schemaName string, db *sql.DB) ([]stage, er dbs := []stage{} err = sqlx.StructScan(rows, &dbs) if err == sql.ErrNoRows { - log.Printf("[DEBUG] no stages found") + log.Println("[DEBUG] no stages found") return nil, nil } return dbs, errors.Wrapf(err, "unable to scan row for %s", stmt) diff --git a/pkg/snowflake/storage_integration.go b/pkg/snowflake/storage_integration.go index b681d38b08..bae8509d14 100644 --- a/pkg/snowflake/storage_integration.go +++ b/pkg/snowflake/storage_integration.go @@ -51,7 +51,7 @@ func ListStorageIntegrations(db *sql.DB) ([]storageIntegration, error) { dbs := []storageIntegration{} err = sqlx.StructScan(rows, &dbs) if err == sql.ErrNoRows { - log.Printf("[DEBUG] no resouce monitors found") + log.Println("[DEBUG] no resouce monitors found") return nil, nil } return dbs, errors.Wrapf(err, "unable to scan row for %s", stmt) diff --git a/pkg/snowflake/stream.go b/pkg/snowflake/stream.go index 28d6cef31e..381bd3c3d9 100644 --- a/pkg/snowflake/stream.go +++ b/pkg/snowflake/stream.go @@ -179,7 +179,7 @@ func ListStreams(databaseName string, schemaName string, db *sql.DB) ([]descStre dbs := []descStreamRow{} err = sqlx.StructScan(rows, &dbs) if err == sql.ErrNoRows { - log.Printf("[DEBUG] no stages found") + log.Println("[DEBUG] no stages found") return nil, nil } return dbs, errors.Wrapf(err, "unable to scan row for %s", stmt) diff --git a/pkg/snowflake/table.go b/pkg/snowflake/table.go index 31effd7fd5..307ca08edb 100644 --- a/pkg/snowflake/table.go +++ b/pkg/snowflake/table.go @@ -381,7 +381,7 @@ func (tb *TableBuilder) UnsetTag(tag TagValue) string { return fmt.Sprintf(`ALTER TABLE %s UNSET TAG "%v"."%v"."%v"`, tb.QualifiedName(), tag.Database, tag.Schema, tag.Name) } -//Function to get clustering definition +// Function to get clustering definition func (tb *TableBuilder) GetClusterKeyString() string { return JoinStringList(tb.clusterBy[:], ", ") @@ -442,7 +442,7 @@ func (tb *TableBuilder) getCreateStatementBody() string { return q.String() } -//function to take the literal snowflake cluster statement returned from SHOW TABLES and convert it to a list of keys. +// function to take the literal snowflake cluster statement returned from SHOW TABLES and convert it to a list of keys. func ClusterStatementToList(clusterStatement string) []string { if clusterStatement == "" { return nil @@ -758,7 +758,7 @@ func ListTables(databaseName string, schemaName string, db *sql.DB) ([]table, er dbs := []table{} err = sqlx.StructScan(rows, &dbs) if err == sql.ErrNoRows { - log.Printf("[DEBUG] no tables found") + log.Println("[DEBUG] no tables found") return nil, nil } return dbs, errors.Wrapf(err, "unable to scan row for %s", stmt) diff --git a/pkg/snowflake/tag.go b/pkg/snowflake/tag.go index f9de034712..b5d4b5780a 100644 --- a/pkg/snowflake/tag.go +++ b/pkg/snowflake/tag.go @@ -225,7 +225,7 @@ func ListTags(databaseName, schemaName string, db *sql.DB) ([]tag, error) { tags := []tag{} err = sqlx.StructScan(rows, &tags) if err == sql.ErrNoRows { - log.Printf("[DEBUG] no tags found") + log.Println("[DEBUG] no tags found") return nil, nil } return tags, errors.Wrapf(err, "unable to scan row for %s", stmt) diff --git a/pkg/snowflake/task.go b/pkg/snowflake/task.go index 7f626843f1..18b3f3e8de 100644 --- a/pkg/snowflake/task.go +++ b/pkg/snowflake/task.go @@ -418,7 +418,7 @@ func ListTasks(databaseName string, schemaName string, db *sql.DB) ([]task, erro dbs := []task{} err = sqlx.StructScan(rows, &dbs) if err == sql.ErrNoRows { - log.Printf("[DEBUG] no tasks found") + log.Println("[DEBUG] no tasks found") return nil, nil } return dbs, errors.Wrapf(err, "unable to scan row for %s", stmt) diff --git a/pkg/snowflake/user.go b/pkg/snowflake/user.go index 93224b758b..0d8e28b412 100644 --- a/pkg/snowflake/user.go +++ b/pkg/snowflake/user.go @@ -112,7 +112,7 @@ func ListUsers(pattern string, db *sql.DB) ([]user, error) { dbs := []user{} err = sqlx.StructScan(rows, &dbs) if err == sql.ErrNoRows { - log.Printf("[DEBUG] no users found") + log.Println("[DEBUG] no users found") return nil, nil } return dbs, errors.Wrapf(err, "unable to scan row for %s", stmt) diff --git a/pkg/snowflake/view.go b/pkg/snowflake/view.go index bac80b16ea..6109023d20 100644 --- a/pkg/snowflake/view.go +++ b/pkg/snowflake/view.go @@ -26,7 +26,7 @@ type ViewBuilder struct { // QualifiedName prepends the db and schema if set and escapes everything nicely func (vb *ViewBuilder) QualifiedName() (string, error) { if vb.db == "" || vb.schema == "" { - return "", errors.New("Views must specify a database and a schema") + return "", errors.New("views must specify a database and a schema") } return fmt.Sprintf(`"%v"."%v"."%v"`, vb.db, vb.schema, vb.name), nil @@ -235,7 +235,7 @@ func ListViews(databaseName string, schemaName string, db *sql.DB) ([]view, erro dbs := []view{} err = sqlx.StructScan(rows, &dbs) if err == sql.ErrNoRows { - log.Printf("[DEBUG] no views found") + log.Println("[DEBUG] no views found") return nil, nil } return dbs, pe.Wrapf(err, "unable to scan row for %s", stmt) diff --git a/pkg/snowflake/warehouse.go b/pkg/snowflake/warehouse.go index 78805af27c..3c4ce9e86d 100644 --- a/pkg/snowflake/warehouse.go +++ b/pkg/snowflake/warehouse.go @@ -128,7 +128,7 @@ func ListWarehouses(db *sql.DB) ([]warehouse, error) { dbs := []warehouse{} err = sqlx.StructScan(rows, &dbs) if err == sql.ErrNoRows { - log.Printf("[DEBUG] no warehouses found") + log.Println("[DEBUG] no warehouses found") return nil, nil } return dbs, errors.Wrapf(err, "unable to scan row for %s", stmt)