Skip to content

Commit

Permalink
Merge pull request #6118 from terraform-providers/b/update-linter
Browse files Browse the repository at this point in the history
linting: updating to account for the gosimple linter
  • Loading branch information
tombuildsstuff authored Mar 16, 2020
2 parents 10747b3 + 2b7606d commit 6896d70
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions azurerm/internal/acceptance/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ func testCheckAzureRMMarketplaceAgreementDestroy(s *terraform.State) error {
}

func testAccAzureRMMarketplaceAgreement_basicConfig() string {
return fmt.Sprintf(`
return `
provider "azurerm" {
features {}
}
Expand All @@ -193,7 +193,7 @@ resource "azurerm_marketplace_agreement" "test" {
offer = "waf"
plan = "hourly"
}
`)
`
}

func testAccAzureRMMarketplaceAgreement_requiresImportConfig() string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
}
Expand All @@ -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 {}
}
Expand All @@ -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 {}
}
Expand All @@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions azurerm/internal/tools/website-scaffold/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 6896d70

Please sign in to comment.