Skip to content

Commit

Permalink
Use indexed verbs in format strings
Browse files Browse the repository at this point in the history
Signed-off-by: Owen Farrell <[email protected]>
  • Loading branch information
owenfarrell committed Sep 28, 2021
1 parent a3d2415 commit 51a3d9d
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions internal/services/synapse/synapse_firewall_rule_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func (r SynapseFirewallRuleResource) Exists(ctx context.Context, client *clients
if utils.ResponseWasNotFound(resp.Response) {
return utils.Bool(false), nil
}
return nil, fmt.Errorf("retrieving Synapse Firewall Rule %q (Workspace %q / Resource Group %q): %+v", id.Name, id.WorkspaceName, id.ResourceGroup, err)
return nil, fmt.Errorf("retrieving %s: %+v", id, err)
}

return utils.Bool(true), nil
Expand All @@ -87,10 +87,10 @@ func (r SynapseFirewallRuleResource) Exists(ctx context.Context, client *clients
func (r SynapseFirewallRuleResource) basic(data acceptance.TestData) string {
template := r.template(data)
return fmt.Sprintf(`
%s
%[1]s
resource "azurerm_synapse_firewall_rule" "test" {
name = "FirewallRule%d"
name = "FirewallRule%[2]d"
synapse_workspace_id = azurerm_synapse_workspace.test.id
start_ip_address = "0.0.0.0"
end_ip_address = "255.255.255.255"
Expand All @@ -101,7 +101,7 @@ resource "azurerm_synapse_firewall_rule" "test" {
func (r SynapseFirewallRuleResource) requiresImport(data acceptance.TestData) string {
config := r.basic(data)
return fmt.Sprintf(`
%s
%[1]s
resource "azurerm_synapse_firewall_rule" "import" {
name = azurerm_synapse_firewall_rule.test.name
Expand All @@ -115,10 +115,10 @@ resource "azurerm_synapse_firewall_rule" "import" {
func (r SynapseFirewallRuleResource) withUpdates(data acceptance.TestData) string {
template := r.template(data)
return fmt.Sprintf(`
%s
%[1]s
resource "azurerm_synapse_firewall_rule" "test" {
name = "FirewallRule%d"
name = "FirewallRule%[2]d"
synapse_workspace_id = azurerm_synapse_workspace.test.id
start_ip_address = "10.0.17.62"
end_ip_address = "10.0.17.62"
Expand All @@ -133,12 +133,12 @@ provider "azurerm" {
}
resource "azurerm_resource_group" "test" {
name = "acctestRG-synapse-%d"
location = "%s"
name = "acctestRG-synapse-%[1]d"
location = "%[2]s"
}
resource "azurerm_storage_account" "test" {
name = "acctestacc%s"
name = "acctestacc%[3]s"
resource_group_name = azurerm_resource_group.test.name
location = azurerm_resource_group.test.location
account_kind = "BlobStorage"
Expand All @@ -147,17 +147,17 @@ resource "azurerm_storage_account" "test" {
}
resource "azurerm_storage_data_lake_gen2_filesystem" "test" {
name = "acctest-%d"
name = "acctest-%[1]d"
storage_account_id = azurerm_storage_account.test.id
}
resource "azurerm_synapse_workspace" "test" {
name = "acctestsw%d"
name = "acctestsw%[1]d"
resource_group_name = azurerm_resource_group.test.name
location = azurerm_resource_group.test.location
storage_data_lake_gen2_filesystem_id = azurerm_storage_data_lake_gen2_filesystem.test.id
sql_administrator_login = "sqladminuser"
sql_administrator_login_password = "H@Sh1CoR3!"
}
`, data.RandomInteger, data.Locations.Primary, data.RandomString, data.RandomInteger, data.RandomInteger)
`, data.RandomInteger, data.Locations.Primary, data.RandomString)
}

0 comments on commit 51a3d9d

Please sign in to comment.