diff --git a/.ci/magician/cmd/scheduled_pr_reminders_test.go b/.ci/magician/cmd/scheduled_pr_reminders_test.go index 760cf6e9fb60..8b4dfff458a4 100644 --- a/.ci/magician/cmd/scheduled_pr_reminders_test.go +++ b/.ci/magician/cmd/scheduled_pr_reminders_test.go @@ -805,7 +805,7 @@ func TestFormatReminderComment(t *testing.T) { &github.User{Login: github.String("other-reviewer")}, }, }, - state: waitingForMerge, + state: waitingForMerge, sinceDays: 5, expectedStrings: []string{ "waiting for merge for 1 week", diff --git a/.ci/magician/cmd/templates_test.go b/.ci/magician/cmd/templates_test.go index 2de0e832daaf..503eb90fb49e 100644 --- a/.ci/magician/cmd/templates_test.go +++ b/.ci/magician/cmd/templates_test.go @@ -24,16 +24,16 @@ func TestColor(t *testing.T) { want: "🟡 Test text", }, { - name: "green", + name: "green", color: "green", - text: "Test text", - want: "🟢 Test text", + text: "Test text", + want: "🟢 Test text", }, { - name: "unsupported color", + name: "unsupported color", color: "mauve", - text: "Test text", - want: "Test text", + text: "Test text", + want: "Test text", }, { name: "empty color", diff --git a/.ci/magician/cmd/test_terraform_vcr.go b/.ci/magician/cmd/test_terraform_vcr.go index 519d1ef1a39e..bd85ae8956fe 100644 --- a/.ci/magician/cmd/test_terraform_vcr.go +++ b/.ci/magician/cmd/test_terraform_vcr.go @@ -475,8 +475,8 @@ func init() { func formatComment(fileName string, tmplText string, data any) (string, error) { funcs := template.FuncMap{ - "join": strings.Join, - "add": func(i, j int) int { return i + j }, + "join": strings.Join, + "add": func(i, j int) int { return i + j }, "color": color, } tmpl, err := template.New(fileName).Funcs(funcs).Parse(tmplText) diff --git a/.ci/magician/cmd/test_terraform_vcr_test.go b/.ci/magician/cmd/test_terraform_vcr_test.go index 2110da3bbb72..03477aa5bedd 100644 --- a/.ci/magician/cmd/test_terraform_vcr_test.go +++ b/.ci/magician/cmd/test_terraform_vcr_test.go @@ -467,8 +467,8 @@ func TestWithReplayFailedTests(t *testing.T) { func TestWithoutReplayFailedTests(t *testing.T) { tests := []struct { - name string - data withoutReplayFailedTests + name string + data withoutReplayFailedTests wantContains []string }{ { @@ -512,8 +512,8 @@ func TestWithoutReplayFailedTests(t *testing.T) { func TestRecordReplay(t *testing.T) { tests := []struct { - name string - data recordReplay + name string + data recordReplay wantContains []string }{ { diff --git a/.ci/magician/cmd/test_tgc_test.go b/.ci/magician/cmd/test_tgc_test.go index 5e67dcca8e59..e3f89fb98445 100644 --- a/.ci/magician/cmd/test_tgc_test.go +++ b/.ci/magician/cmd/test_tgc_test.go @@ -28,7 +28,7 @@ func TestExecTestTGC(t *testing.T) { execTestTGC("sha1", "pr1", gh) method := "CreateWorkflowDispatchEvent" - expected := [][]any{{"test-tgc.yml", map[string]any{"tpgb-branch": "auto-pr-pr1", "tgc-branch": "auto-pr-pr1", "pr-number":"pr1", "owner": "modular-magician", "repo": "terraform-google-conversion", "sha": "sha1"}}} + expected := [][]any{{"test-tgc.yml", map[string]any{"tpgb-branch": "auto-pr-pr1", "tgc-branch": "auto-pr-pr1", "pr-number": "pr1", "owner": "modular-magician", "repo": "terraform-google-conversion", "sha": "sha1"}}} if calls, ok := gh.calledMethods[method]; !ok { t.Fatal("Workflow dispatch event not created") } else if !reflect.DeepEqual(calls, expected) { diff --git a/.ci/magician/cmd/test_tpg.go b/.ci/magician/cmd/test_tpg.go index 12c0b12c441c..8468aa490c50 100644 --- a/.ci/magician/cmd/test_tpg.go +++ b/.ci/magician/cmd/test_tpg.go @@ -17,9 +17,9 @@ package cmd import ( "fmt" + "github.com/spf13/cobra" "magician/github" "os" - "github.com/spf13/cobra" ) type ttGithub interface { @@ -73,7 +73,7 @@ func execTestTPG(version, commit, pr string, gh ttGithub) error { commitShaOrBranchUpstream := string(content) - if commitShaOrBranchUpstream == ""{ + if commitShaOrBranchUpstream == "" { // fall back to branch if commit SHA can't be found commitShaOrBranchUpstream = "auto-pr-" + pr } diff --git a/mmv1/third_party/terraform/services/sql/resource_sql_database_test.go b/mmv1/third_party/terraform/services/sql/resource_sql_database_test.go index 939a8fa37fdc..44250cab79f0 100644 --- a/mmv1/third_party/terraform/services/sql/resource_sql_database_test.go +++ b/mmv1/third_party/terraform/services/sql/resource_sql_database_test.go @@ -157,9 +157,9 @@ func testAccCheckGoogleSqlDatabaseExists(t *testing.T, n string, database *sqlad *database = *found - return nil - } - } + return nil + } +} func testAccSqlDatabaseDestroyProducer(t *testing.T) func(s *terraform.State) error { return func(s *terraform.State) error { @@ -197,7 +197,7 @@ func TestAccSqlDatabase_instanceWithActivationPolicy(t *testing.T) { CheckDestroy: testAccSqlDatabaseDestroyProducer(t), Steps: []resource.TestStep{ { - Config: testGoogleSqlDatabase_instanceWithActivationPolicy(instance_name, database_name , "ALWAYS"), + Config: testGoogleSqlDatabase_instanceWithActivationPolicy(instance_name, database_name, "ALWAYS"), Check: resource.ComposeTestCheckFunc( testAccCheckGoogleSqlDatabaseExists( t, "google_sql_database.database", &database), @@ -241,10 +241,9 @@ resource "google_sql_database" "database" { name = "%s" instance = google_sql_database_instance.instance.name } -`, instance_name, activationPolicy, database_name,) +`, instance_name, activationPolicy, database_name) } - var testGoogleSqlDatabase_basic = ` resource "google_sql_database_instance" "instance" { name = "%s" diff --git a/tools/diff-processor/breaking_changes/resource_config_diff.go b/tools/diff-processor/breaking_changes/resource_config_diff.go index 95eb5526c754..9edea8de0a48 100644 --- a/tools/diff-processor/breaking_changes/resource_config_diff.go +++ b/tools/diff-processor/breaking_changes/resource_config_diff.go @@ -10,7 +10,7 @@ import ( // structure for rules regarding resource config changes type ResourceConfigDiffRule struct { Identifier string - Messages func(resource string, resourceConfigDiff diff.ResourceConfigDiff) []string + Messages func(resource string, resourceConfigDiff diff.ResourceConfigDiff) []string } // ResourceConfigDiffRules is a list of ResourceConfigDiffRule diff --git a/tools/diff-processor/breaking_changes/resource_config_diff_test.go b/tools/diff-processor/breaking_changes/resource_config_diff_test.go index 6a8e25607a05..83d278b50c52 100644 --- a/tools/diff-processor/breaking_changes/resource_config_diff_test.go +++ b/tools/diff-processor/breaking_changes/resource_config_diff_test.go @@ -44,4 +44,4 @@ var resourceConfigRemovingAResourceTestCases = []resourceInventoryTestCase{ new: nil, wantViolations: true, }, -} \ No newline at end of file +} diff --git a/tools/diff-processor/cmd/breaking_changes.go b/tools/diff-processor/cmd/breaking_changes.go index 72d14cdb95bb..bd16d705f67c 100644 --- a/tools/diff-processor/cmd/breaking_changes.go +++ b/tools/diff-processor/cmd/breaking_changes.go @@ -10,8 +10,8 @@ import ( "os" "sort" - "github.com/GoogleCloudPlatform/magic-modules/tools/diff-processor/diff" "github.com/GoogleCloudPlatform/magic-modules/tools/diff-processor/breaking_changes" + "github.com/GoogleCloudPlatform/magic-modules/tools/diff-processor/diff" "github.com/spf13/cobra" ) diff --git a/tools/diff-processor/cmd/breaking_changes_test.go b/tools/diff-processor/cmd/breaking_changes_test.go index a4c7f37a8f57..e9e7ac20a64e 100644 --- a/tools/diff-processor/cmd/breaking_changes_test.go +++ b/tools/diff-processor/cmd/breaking_changes_test.go @@ -5,8 +5,8 @@ import ( "encoding/json" "testing" - "github.com/GoogleCloudPlatform/magic-modules/tools/diff-processor/diff" "github.com/GoogleCloudPlatform/magic-modules/tools/diff-processor/breaking_changes" + "github.com/GoogleCloudPlatform/magic-modules/tools/diff-processor/diff" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/tpgtools/property_helpers.go b/tpgtools/property_helpers.go index 459d815ff509..bb81101fe0f5 100644 --- a/tpgtools/property_helpers.go +++ b/tpgtools/property_helpers.go @@ -1,11 +1,11 @@ // Copyright 2021 Google LLC. All Rights Reserved. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/tpgtools/serializable/serializable.go b/tpgtools/serializable/serializable.go index 43ef251d219a..01b29133090f 100644 --- a/tpgtools/serializable/serializable.go +++ b/tpgtools/serializable/serializable.go @@ -1,11 +1,11 @@ // Copyright 2021 Google LLC. All Rights Reserved. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/tpgtools/serializable/serializable_test.go b/tpgtools/serializable/serializable_test.go index cb9000c0a0ea..73fa51816be7 100644 --- a/tpgtools/serializable/serializable_test.go +++ b/tpgtools/serializable/serializable_test.go @@ -1,11 +1,11 @@ // Copyright 2021 Google LLC. All Rights Reserved. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -18,7 +18,7 @@ import ( "testing" ) -func TestListOfResources(t *testing.T) { +func TestListOfResources(t *testing.T) { services, err := ListOfResources("test_specs") if err != nil { t.Errorf("received error: %v", err) diff --git a/tpgtools/serialization_helpers.go b/tpgtools/serialization_helpers.go index 4be1b3800d45..e362def5319d 100644 --- a/tpgtools/serialization_helpers.go +++ b/tpgtools/serialization_helpers.go @@ -7,8 +7,8 @@ import ( "strings" cloudresourcemanager "github.com/GoogleCloudPlatform/declarative-resource-client-library/services/google/cloudresourcemanager" - cloudresourcemanagerBeta "github.com/GoogleCloudPlatform/declarative-resource-client-library/services/google/cloudresourcemanager/beta" cloudresourcemanagerAlpha "github.com/GoogleCloudPlatform/declarative-resource-client-library/services/google/cloudresourcemanager/alpha" + cloudresourcemanagerBeta "github.com/GoogleCloudPlatform/declarative-resource-client-library/services/google/cloudresourcemanager/beta" ) func serializeAlphaProjectToHCL(r cloudresourcemanagerAlpha.Project, hasGAEquivalent bool) (string, error) { diff --git a/tpgtools/type.go b/tpgtools/type.go index cb31f0a7c562..0e1a43a4342c 100644 --- a/tpgtools/type.go +++ b/tpgtools/type.go @@ -1,11 +1,11 @@ // Copyright 2021 Google LLC. All Rights Reserved. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.