From 2113976f1add51f88d9cbb0056da4afdca6e9190 Mon Sep 17 00:00:00 2001 From: Modular Magician Date: Fri, 3 Oct 2025 17:13:39 +0000 Subject: [PATCH] `GO`: Upgrade Go version from `1.23` -> `1.24` (#15293) Co-authored-by: Stephen Lewis (Burrows) [upstream:d2e1e4a59ab8812bba8ed991b46f034301644c5a] Signed-off-by: Modular Magician --- .go-version | 2 +- go.mod | 2 +- google-beta/acctest/diff_utils.go | 2 +- google-beta/services/container/container_operation.go | 2 +- .../services/dataproc/resource_dataproc_job_test.go | 2 +- google-beta/services/kms/kms_utils.go | 2 +- .../data_source_google_service_accounts_test.go | 8 +++++--- google-beta/services/storage/storage_operation.go | 2 +- google-beta/sweeper/hashi_sweeper_fork.go | 2 +- google-beta/transport/batcher_test.go | 2 +- google-beta/transport/retry_transport_test.go | 2 +- scripts/go.mod | 2 +- 12 files changed, 16 insertions(+), 14 deletions(-) diff --git a/.go-version b/.go-version index a1b6e17d61..3900bcd9fd 100644 --- a/.go-version +++ b/.go-version @@ -1 +1 @@ -1.23 +1.24 diff --git a/go.mod b/go.mod index 010b7162df..fdcbd1ec01 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/hashicorp/terraform-provider-google-beta -go 1.23.0 +go 1.24.0 require ( cloud.google.com/go/auth v0.16.5 diff --git a/google-beta/acctest/diff_utils.go b/google-beta/acctest/diff_utils.go index daa65895a6..fa4547f092 100644 --- a/google-beta/acctest/diff_utils.go +++ b/google-beta/acctest/diff_utils.go @@ -213,7 +213,7 @@ func writeOutputFileDeferFunction(tempOutputFile *os.File, failed bool) { fmt.Fprintf(os.Stdout, "%s Breaking Change Detected] \n", diffTag) fmt.Fprintf(diffFailureFile, "%s %s\n", diffTag, testOutput) } else { - fmt.Fprintf(regularFailureFile, testOutput) + fmt.Fprintf(regularFailureFile, "%s", testOutput) fmt.Fprintf(regularFailureFile, "FAILED --- %s\n", testOutput) } } diff --git a/google-beta/services/container/container_operation.go b/google-beta/services/container/container_operation.go index 6322bf9371..d42a1ff54c 100644 --- a/google-beta/services/container/container_operation.go +++ b/google-beta/services/container/container_operation.go @@ -60,7 +60,7 @@ func (w *ContainerOperationWaiter) Error() error { } if w.Op.StatusMessage != "" { - return fmt.Errorf(w.Op.StatusMessage) + return fmt.Errorf("%s", w.Op.StatusMessage) } return nil diff --git a/google-beta/services/dataproc/resource_dataproc_job_test.go b/google-beta/services/dataproc/resource_dataproc_job_test.go index 801fae063f..ea10d756ca 100644 --- a/google-beta/services/dataproc/resource_dataproc_job_test.go +++ b/google-beta/services/dataproc/resource_dataproc_job_test.go @@ -561,7 +561,7 @@ func testAccCheckDataprocJobAttrMatch(n, jobType string, job *dataproc.Job) reso for _, attrs := range jobTests { if c := checkMatch(attributes, attrs.tf_attr, attrs.gcp_attr); c != "" { - return fmt.Errorf(c) + return fmt.Errorf("%s", c) } } diff --git a/google-beta/services/kms/kms_utils.go b/google-beta/services/kms/kms_utils.go index 0305d1e296..e04ac8ac36 100644 --- a/google-beta/services/kms/kms_utils.go +++ b/google-beta/services/kms/kms_utils.go @@ -128,7 +128,7 @@ type kmsCryptoKeyVersionId struct { } func (s *kmsCryptoKeyVersionId) cryptoKeyVersionId() string { - return fmt.Sprintf(s.Name) + return s.Name } func (s *kmsCryptoKeyVersionId) TerraformId() string { diff --git a/google-beta/services/resourcemanager/data_source_google_service_accounts_test.go b/google-beta/services/resourcemanager/data_source_google_service_accounts_test.go index 47bcbbfd35..dcffc1545a 100644 --- a/google-beta/services/resourcemanager/data_source_google_service_accounts_test.go +++ b/google-beta/services/resourcemanager/data_source_google_service_accounts_test.go @@ -72,7 +72,7 @@ func TestAccDataSourceGoogleServiceAccounts_basic(t *testing.T) { resource.TestCheckResourceAttr("data.google_service_accounts.with_regex", "accounts.0.email", fmt.Sprintf("%s@%s.iam.gserviceaccount.com", sa_1, project)), // Check if the account_id matches the prefix - resource.TestCheckResourceAttr("data.google_service_accounts.with_prefix_and_regex", "accounts.0.account_id", fmt.Sprintf(sa_1)), + resource.TestCheckResourceAttr("data.google_service_accounts.with_prefix_and_regex", "accounts.0.account_id", sa_1), // Check if the email matches the regex resource.TestCheckResourceAttr("data.google_service_accounts.with_prefix_and_regex", "accounts.0.email", fmt.Sprintf("%s@%s.iam.gserviceaccount.com", sa_1, project)), @@ -118,17 +118,19 @@ data "google_service_accounts" "with_prefix" { data "google_service_accounts" "with_regex" { project = local.project_id - regex = ".*${google_service_account.sa_one.account_id}.*@.*\\.gserviceaccount\\.com" + regex = ".*%s.*@.*\\.gserviceaccount\\.com" } data "google_service_accounts" "with_prefix_and_regex" { prefix = google_service_account.sa_one.account_id project = local.project_id - regex = ".*${google_service_account.sa_one.account_id}.*@.*\\.gserviceaccount\\.com" + regex = ".*%s.*@.*\\.gserviceaccount\\.com" } `, context["project"].(string), context["sa_1"].(string), context["sa_2"].(string), + context["sa_1"].(string), + context["sa_1"].(string), ) } diff --git a/google-beta/services/storage/storage_operation.go b/google-beta/services/storage/storage_operation.go index 862dcaca29..480f7a2365 100644 --- a/google-beta/services/storage/storage_operation.go +++ b/google-beta/services/storage/storage_operation.go @@ -50,7 +50,7 @@ func (w *StorageOperationWaiter) QueryOp() (interface{}, error) { } // Returns the proper get. - url := fmt.Sprintf(w.SelfLink) + url := w.SelfLink return transport_tpg.SendRequest(transport_tpg.SendRequestOptions{ Config: w.Config, diff --git a/google-beta/sweeper/hashi_sweeper_fork.go b/google-beta/sweeper/hashi_sweeper_fork.go index 783d056040..35f67abd34 100644 --- a/google-beta/sweeper/hashi_sweeper_fork.go +++ b/google-beta/sweeper/hashi_sweeper_fork.go @@ -483,7 +483,7 @@ func validateParentSweepers(sweepers map[string]*Sweeper) error { // If any validation errors were found, return them if len(validationErrors) > 0 { if len(validationErrors) == 1 { - return fmt.Errorf(validationErrors[0]) + return fmt.Errorf("%s", validationErrors[0]) } return fmt.Errorf("multiple parent validation issues: %s", strings.Join(validationErrors, "; ")) } diff --git a/google-beta/transport/batcher_test.go b/google-beta/transport/batcher_test.go index 795b763e01..0f73619ebd 100644 --- a/google-beta/transport/batcher_test.go +++ b/google-beta/transport/batcher_test.go @@ -169,7 +169,7 @@ func TestRequestBatcher_errInSend(t *testing.T) { log.Printf("[DEBUG] sendBatch body: %+v", body) for _, v := range body.([]int) { if v == failIdx { - return nil, fmt.Errorf(expectedErrMsg) + return nil, fmt.Errorf("%s", expectedErrMsg) } } return nil, nil diff --git a/google-beta/transport/retry_transport_test.go b/google-beta/transport/retry_transport_test.go index e2a3f30997..6ee2b06462 100644 --- a/google-beta/transport/retry_transport_test.go +++ b/google-beta/transport/retry_transport_test.go @@ -307,7 +307,7 @@ func testRetryTransport_checkBody(t *testing.T, resp *http.Response, expectedMsg expectedBody := fmt.Sprintf("Request Body: %s", expectedMsg) if !strings.HasSuffix(string(actualBody), expectedBody) { - t.Fatalf(expectedBody) + t.Fatalf("%s", expectedBody) } } diff --git a/scripts/go.mod b/scripts/go.mod index 80546d3387..ec7963a351 100755 --- a/scripts/go.mod +++ b/scripts/go.mod @@ -1,3 +1,3 @@ module github.com/hashicorp/terraform-provider-google-beta/scripts -go 1.23 +go 1.24