From 61f0388d5ddf0c2bb42921c27d0bb3067840c92b Mon Sep 17 00:00:00 2001 From: Sarah French <15078782+SarahFrench@users.noreply.github.com> Date: Thu, 30 Nov 2023 22:05:15 +0000 Subject: [PATCH] Upgrade to Go 1.20 (#9506) * Upgrade TPG/TPGB go.mod to Go 1.20 * Upgrade doctor script to check users have Go 1.20 for building the provider * Update workflows that interact with the provider codebase directly * Update tpgtools to Go 1.20 * Upgrade everything else from Go 1.19 to Go 1.20 --- .ci/magician/go.mod | 2 +- .github/workflows/build-downstream.yml | 2 +- .github/workflows/membership-checker.yml | 2 +- .github/workflows/test-tgc.yml | 2 +- .github/workflows/test-tpg.yml | 2 +- .github/workflows/unit-test-tgc.yml | 2 +- .github/workflows/unit-test-tpg.yml | 2 +- .github/workflows/unit-tests-diff-processor.yml | 2 +- docs/go.mod | 2 +- mmv1/third_party/terraform/go.mod.erb | 2 +- scripts/doctor | 4 ++-- tools/diff-processor/go.mod | 2 +- tools/issue-labeler/go.mod | 2 +- tools/missing-test-detector/go.mod | 2 +- tools/teamcity-generator/go.mod | 2 +- tpgtools/go.mod | 2 +- 16 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.ci/magician/go.mod b/.ci/magician/go.mod index 4ebd7498dd30..7816d11ecd61 100644 --- a/.ci/magician/go.mod +++ b/.ci/magician/go.mod @@ -1,6 +1,6 @@ module magician -go 1.19 +go 1.20 require ( github.com/inconshreveable/mousetrap v1.1.0 // indirect diff --git a/.github/workflows/build-downstream.yml b/.github/workflows/build-downstream.yml index 04312df88454..32fe3e526d37 100644 --- a/.github/workflows/build-downstream.yml +++ b/.github/workflows/build-downstream.yml @@ -47,7 +47,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: '^1.19' + go-version: '^1.20' # Cache Go modules - name: Cache Go modules diff --git a/.github/workflows/membership-checker.yml b/.github/workflows/membership-checker.yml index fbc1d10bba62..2612f2c61679 100644 --- a/.github/workflows/membership-checker.yml +++ b/.github/workflows/membership-checker.yml @@ -15,7 +15,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: '^1.19.1' + go-version: '^1.20.1' - name: Run membership checker unit tests run: | cd .ci/magician diff --git a/.github/workflows/test-tgc.yml b/.github/workflows/test-tgc.yml index e1654f092c1e..1546a5c856ee 100644 --- a/.github/workflows/test-tgc.yml +++ b/.github/workflows/test-tgc.yml @@ -81,7 +81,7 @@ jobs: if: ${{ !failure() && steps.pull_request.outputs.has_changes == 'true' }} uses: actions/setup-go@v3 with: - go-version: '^1.19' + go-version: '^1.20' - name: Build Terraform Google Conversion if: ${{ !failure() && steps.pull_request.outputs.has_changes == 'true' }} run: | diff --git a/.github/workflows/test-tpg.yml b/.github/workflows/test-tpg.yml index de61efccb631..0b5148f7d1e2 100644 --- a/.github/workflows/test-tpg.yml +++ b/.github/workflows/test-tpg.yml @@ -82,7 +82,7 @@ jobs: if: ${{ !failure() && steps.pull_request.outputs.has_changes == 'true' }} uses: actions/setup-go@v3 with: - go-version: '^1.19' + go-version: '^1.20' - name: Build Provider if: ${{ !failure() && steps.pull_request.outputs.has_changes == 'true' }} run: | diff --git a/.github/workflows/unit-test-tgc.yml b/.github/workflows/unit-test-tgc.yml index e718ea8066f7..e1c983d92ba8 100644 --- a/.github/workflows/unit-test-tgc.yml +++ b/.github/workflows/unit-test-tgc.yml @@ -30,7 +30,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: '^1.19' + go-version: '^1.20' - name: Cache Go modules and build cache uses: actions/cache@v3 diff --git a/.github/workflows/unit-test-tpg.yml b/.github/workflows/unit-test-tpg.yml index 4bfb4dd80d87..ddb48186ff43 100644 --- a/.github/workflows/unit-test-tpg.yml +++ b/.github/workflows/unit-test-tpg.yml @@ -28,7 +28,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: '^1.19' + go-version: '^1.20' - name: Cache Go modules and build cache uses: actions/cache@v3 diff --git a/.github/workflows/unit-tests-diff-processor.yml b/.github/workflows/unit-tests-diff-processor.yml index 33efabed2a26..638fb42c60c5 100644 --- a/.github/workflows/unit-tests-diff-processor.yml +++ b/.github/workflows/unit-tests-diff-processor.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: '^1.19.1' + go-version: '^1.20.1' - name: Build run: | diff --git a/docs/go.mod b/docs/go.mod index bb57693d8662..35af46f9dda9 100644 --- a/docs/go.mod +++ b/docs/go.mod @@ -1,6 +1,6 @@ module github.com/GoogleCloudPlatform/magic-modules/docs -go 1.19 +go 1.20 require ( github.com/alex-shpak/hugo-book v0.0.0-20230424134111-d86d5e70c7c0 // indirect diff --git a/mmv1/third_party/terraform/go.mod.erb b/mmv1/third_party/terraform/go.mod.erb index c75615613c2f..e887f11fecab 100644 --- a/mmv1/third_party/terraform/go.mod.erb +++ b/mmv1/third_party/terraform/go.mod.erb @@ -1,6 +1,6 @@ <% autogen_exception -%> module github.com/hashicorp/terraform-provider-google -go 1.19 +go 1.20 require ( cloud.google.com/go/bigtable v1.19.0 diff --git a/scripts/doctor b/scripts/doctor index 3da2210779ac..ce131165d7f6 100755 --- a/scripts/doctor +++ b/scripts/doctor @@ -48,9 +48,9 @@ if [ $found -eq 0 ]; then else version=($(go version)) version=${version[2]} - if [[ "$version" < "go1.19.0" ]]; then + if [[ "$version" < "go1.20.0" ]]; then exitcode=1 - warn "yel" " $version is installed, but go 1.19 or later is required. See https://golang.org/doc/install for information on installing it." + warn "yel" " $version is installed, but go 1.20 or later is required. See https://golang.org/doc/install for information on installing it." fi if [[ -z "${GOPATH}" ]]; then exitcode=1 diff --git a/tools/diff-processor/go.mod b/tools/diff-processor/go.mod index 880f54da41c9..78da81c6aeaa 100644 --- a/tools/diff-processor/go.mod +++ b/tools/diff-processor/go.mod @@ -1,6 +1,6 @@ module github.com/GoogleCloudPlatform/magic-modules/tools/diff-processor -go 1.19 +go 1.20 replace google/provider/old => ./old diff --git a/tools/issue-labeler/go.mod b/tools/issue-labeler/go.mod index d0e17c929f42..a1fcbec43647 100644 --- a/tools/issue-labeler/go.mod +++ b/tools/issue-labeler/go.mod @@ -1,6 +1,6 @@ module github.com/GoogleCloudPlatform/magic-modules/tools/issue-labeler -go 1.19 +go 1.20 require ( github.com/golang/glog v1.1.1 diff --git a/tools/missing-test-detector/go.mod b/tools/missing-test-detector/go.mod index 291b412ade2c..3e25a00ea6e2 100644 --- a/tools/missing-test-detector/go.mod +++ b/tools/missing-test-detector/go.mod @@ -1,6 +1,6 @@ module github.com/trodge/magic-modules/tools/missing-test-detector -go 1.19 +go 1.20 replace google/provider/old => github.com/hashicorp/terraform-provider-google-beta v1.20.1-0.20230302220542-203a52c6e3e1 diff --git a/tools/teamcity-generator/go.mod b/tools/teamcity-generator/go.mod index e0b2073fc3a3..3f998f908e09 100644 --- a/tools/teamcity-generator/go.mod +++ b/tools/teamcity-generator/go.mod @@ -1,5 +1,5 @@ module github.com/GoogleCloudPlatform/magic-modules/tools/teamcity-generator -go 1.19 +go 1.20 require golang.org/x/text v0.11.0 diff --git a/tpgtools/go.mod b/tpgtools/go.mod index 6ac80ea9b332..b8256b7777fc 100644 --- a/tpgtools/go.mod +++ b/tpgtools/go.mod @@ -1,6 +1,6 @@ module github.com/GoogleCloudPlatform/magic-modules/tpgtools -go 1.19 +go 1.20 require ( bitbucket.org/creachadair/stringset v0.0.11