From 2b7606de26b2e6c4537416fe4a198d23a6499157 Mon Sep 17 00:00:00 2001 From: tombuildsstuff Date: Mon, 16 Mar 2020 07:28:52 +0100 Subject: [PATCH] linting: updating to account for the gosimple linter --- azurerm/internal/acceptance/data.go | 4 ++-- .../resource_arm_marketplace_agreement_test.go | 4 ++-- .../services/dns/resource_arm_dns_caa_record.go | 2 +- .../services/dns/resource_arm_dns_mx_record.go | 2 +- .../services/dns/resource_arm_dns_ptr_record.go | 2 +- .../services/dns/resource_arm_dns_srv_record.go | 2 +- .../services/dns/resource_arm_dns_txt_record.go | 2 +- .../tests/resource_arm_management_group_test.go | 16 ++++++++-------- azurerm/internal/tools/website-scaffold/main.go | 8 ++++---- 9 files changed, 21 insertions(+), 21 deletions(-) diff --git a/azurerm/internal/acceptance/data.go b/azurerm/internal/acceptance/data.go index e173e4d28348..f92c2b8b51dd 100644 --- a/azurerm/internal/acceptance/data.go +++ b/azurerm/internal/acceptance/data.go @@ -96,7 +96,7 @@ func (td *TestData) RandomIntOfLength(len int) int { // - greater then 18, longest a int can represent // - less then 8, as that gives us YYMMDDRR if 8 > len || len > 18 { - panic(fmt.Sprintf("Invalid Test: RandomIntOfLength: len is not between 8 or 18 inclusive")) + panic("Invalid Test: RandomIntOfLength: len is not between 8 or 18 inclusive") } // 18 - just return the int @@ -122,7 +122,7 @@ func (td *TestData) RandomIntOfLength(len int) int { func (td *TestData) RandomStringOfLength(len int) string { // len should not be less then 1 or greater than 1024 if 1 > len || len > 1024 { - panic(fmt.Sprintf("Invalid Test: RandomStringOfLength: length argument must be between 1 and 1024 characters")) + panic("Invalid Test: RandomStringOfLength: length argument must be between 1 and 1024 characters") } return acctest.RandString(len) diff --git a/azurerm/internal/services/compute/tests/resource_arm_marketplace_agreement_test.go b/azurerm/internal/services/compute/tests/resource_arm_marketplace_agreement_test.go index e5cb76479694..8e5270bc749f 100644 --- a/azurerm/internal/services/compute/tests/resource_arm_marketplace_agreement_test.go +++ b/azurerm/internal/services/compute/tests/resource_arm_marketplace_agreement_test.go @@ -183,7 +183,7 @@ func testCheckAzureRMMarketplaceAgreementDestroy(s *terraform.State) error { } func testAccAzureRMMarketplaceAgreement_basicConfig() string { - return fmt.Sprintf(` + return ` provider "azurerm" { features {} } @@ -193,7 +193,7 @@ resource "azurerm_marketplace_agreement" "test" { offer = "waf" plan = "hourly" } -`) +` } func testAccAzureRMMarketplaceAgreement_requiresImportConfig() string { diff --git a/azurerm/internal/services/dns/resource_arm_dns_caa_record.go b/azurerm/internal/services/dns/resource_arm_dns_caa_record.go index 7cf9ba5944bf..c159d951ab80 100644 --- a/azurerm/internal/services/dns/resource_arm_dns_caa_record.go +++ b/azurerm/internal/services/dns/resource_arm_dns_caa_record.go @@ -205,7 +205,7 @@ func resourceArmDnsCaaRecordDelete(d *schema.ResourceData, meta interface{}) err } func flattenAzureRmDnsCaaRecords(records *[]dns.CaaRecord) []map[string]interface{} { - results := make([]map[string]interface{}, 0, len(*records)) + results := make([]map[string]interface{}, 0) if records != nil { for _, record := range *records { diff --git a/azurerm/internal/services/dns/resource_arm_dns_mx_record.go b/azurerm/internal/services/dns/resource_arm_dns_mx_record.go index a244b4c65eb9..a0b272abc4b8 100644 --- a/azurerm/internal/services/dns/resource_arm_dns_mx_record.go +++ b/azurerm/internal/services/dns/resource_arm_dns_mx_record.go @@ -196,7 +196,7 @@ func resourceArmDnsMxRecordDelete(d *schema.ResourceData, meta interface{}) erro // the expectations of the ResourceData schema, so that this data can be // managed by Terradata state. func flattenAzureRmDnsMxRecords(records *[]dns.MxRecord) []map[string]interface{} { - results := make([]map[string]interface{}, 0, len(*records)) + results := make([]map[string]interface{}, 0) if records != nil { for _, record := range *records { diff --git a/azurerm/internal/services/dns/resource_arm_dns_ptr_record.go b/azurerm/internal/services/dns/resource_arm_dns_ptr_record.go index 8f85a7614154..d878bfd0e27a 100644 --- a/azurerm/internal/services/dns/resource_arm_dns_ptr_record.go +++ b/azurerm/internal/services/dns/resource_arm_dns_ptr_record.go @@ -182,7 +182,7 @@ func resourceArmDnsPtrRecordDelete(d *schema.ResourceData, meta interface{}) err } func flattenAzureRmDnsPtrRecords(records *[]dns.PtrRecord) []string { - results := make([]string, 0, len(*records)) + results := make([]string, 0) if records != nil { for _, record := range *records { diff --git a/azurerm/internal/services/dns/resource_arm_dns_srv_record.go b/azurerm/internal/services/dns/resource_arm_dns_srv_record.go index 456afc758020..313734b8b593 100644 --- a/azurerm/internal/services/dns/resource_arm_dns_srv_record.go +++ b/azurerm/internal/services/dns/resource_arm_dns_srv_record.go @@ -199,7 +199,7 @@ func resourceArmDnsSrvRecordDelete(d *schema.ResourceData, meta interface{}) err } func flattenAzureRmDnsSrvRecords(records *[]dns.SrvRecord) []map[string]interface{} { - results := make([]map[string]interface{}, 0, len(*records)) + results := make([]map[string]interface{}, 0) if records != nil { for _, record := range *records { diff --git a/azurerm/internal/services/dns/resource_arm_dns_txt_record.go b/azurerm/internal/services/dns/resource_arm_dns_txt_record.go index 7a7f7a0c01ff..fafde965c8ba 100644 --- a/azurerm/internal/services/dns/resource_arm_dns_txt_record.go +++ b/azurerm/internal/services/dns/resource_arm_dns_txt_record.go @@ -184,7 +184,7 @@ func resourceArmDnsTxtRecordDelete(d *schema.ResourceData, meta interface{}) err } func flattenAzureRmDnsTxtRecords(records *[]dns.TxtRecord) []map[string]interface{} { - results := make([]map[string]interface{}, 0, len(*records)) + results := make([]map[string]interface{}, 0) if records != nil { for _, record := range *records { diff --git a/azurerm/internal/services/managementgroup/tests/resource_arm_management_group_test.go b/azurerm/internal/services/managementgroup/tests/resource_arm_management_group_test.go index 67a2821ebcf7..d764fed56d5d 100644 --- a/azurerm/internal/services/managementgroup/tests/resource_arm_management_group_test.go +++ b/azurerm/internal/services/managementgroup/tests/resource_arm_management_group_test.go @@ -258,18 +258,18 @@ func testCheckAzureRMManagementGroupDestroy(s *terraform.State) error { } func testAzureRMManagementGroup_basic() string { - return fmt.Sprintf(` + return ` provider "azurerm" { features {} } resource "azurerm_management_group" "test" { } -`) +` } func testAzureRMManagementGroup_requiresImport() string { - return fmt.Sprintf(` + return ` provider "azurerm" { features {} } @@ -280,11 +280,11 @@ resource "azurerm_management_group" "test" { resource "azurerm_management_group" "import" { group_id = azurerm_management_group.test.group_id } -`) +` } func testAzureRMManagementGroup_nested() string { - return fmt.Sprintf(` + return ` provider "azurerm" { features {} } @@ -295,11 +295,11 @@ resource "azurerm_management_group" "parent" { resource "azurerm_management_group" "child" { parent_management_group_id = azurerm_management_group.parent.id } -`) +` } func testAzureRMManagementGroup_multiLevel() string { - return fmt.Sprintf(` + return ` provider "azurerm" { features {} } @@ -314,7 +314,7 @@ resource "azurerm_management_group" "parent" { resource "azurerm_management_group" "child" { parent_management_group_id = azurerm_management_group.parent.id } -`) +` } func testAzureRMManagementGroup_withName(data acceptance.TestData) string { diff --git a/azurerm/internal/tools/website-scaffold/main.go b/azurerm/internal/tools/website-scaffold/main.go index 1029bcdeda3c..7510f33fb6e6 100644 --- a/azurerm/internal/tools/website-scaffold/main.go +++ b/azurerm/internal/tools/website-scaffold/main.go @@ -529,11 +529,11 @@ func (gen documentationGenerator) buildDescriptionForArgument(name string, field } if name == "enabled" || strings.HasSuffix(name, "_enabled") { - return fmt.Sprintf("Should the TODO be enabled?") + return "Should the TODO be enabled?" } if strings.HasSuffix(name, "_id") { - return fmt.Sprintf("The ID of the TODO.") + return "The ID of the TODO." } if field.Elem != nil { @@ -583,11 +583,11 @@ func (gen documentationGenerator) buildDescriptionForAttribute(name string, fiel } if name == "enabled" || strings.HasSuffix(name, "_enabled") { - return fmt.Sprintf("Is the TODO enabled?") + return "Is the TODO enabled?" } if strings.HasSuffix(name, "_id") { - return fmt.Sprintf("The ID of the TODO.") + return "The ID of the TODO." } if field.Elem != nil {