From 92ae53597e622ca15814c8968a29eb66ea7f194e Mon Sep 17 00:00:00 2001 From: Paul Gier Date: Thu, 14 Dec 2023 14:41:50 -0600 Subject: [PATCH] upgrade golang to 1.20 --- .github/workflows/ci.yml | 6 +++--- .github/workflows/release.yml | 2 +- .go-version | 1 - README.md | 2 +- go.mod | 2 +- internal/provider/provider_framework.go | 7 +++++-- 6 files changed, 11 insertions(+), 9 deletions(-) delete mode 100644 .go-version diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 09afad64..ed7fbff3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/setup-go@v4 with: - go-version: '1.19' + go-version: '1.20' - uses: hashicorp/setup-terraform@v3 with: @@ -48,7 +48,7 @@ jobs: - uses: actions/setup-go@v4 with: - go-version: '1.19' + go-version: '1.20' - uses: actions/checkout@v4 @@ -71,7 +71,7 @@ jobs: steps: - uses: actions/setup-go@v4 with: - go-version: '1.18' + go-version: '1.20' - uses: actions/checkout@v4 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 39667621..eefa1102 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,7 +24,7 @@ jobs: - uses: actions/setup-go@v4 with: - go-version: 1.19 + go-version: 1.20 - name: Import GPG key id: import_gpg diff --git a/.go-version b/.go-version deleted file mode 100644 index 4a02d2c3..00000000 --- a/.go-version +++ /dev/null @@ -1 +0,0 @@ -1.16.2 diff --git a/README.md b/README.md index 80d2f3a6..0e4a1718 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ The [examples diretory](./examples) contains example configuration for the vario ### Build the provider from source -The build requires [Go](https://golang.org/doc/install) >= 1.18 +The build requires [Go](https://golang.org/doc/install) >= 1.20 In order to develop and test this provider, you'll need to configure your local environment with a custom Terraform [config file](https://developer.hashicorp.com/terraform/cli/config/config-file). diff --git a/go.mod b/go.mod index a46e3f0d..259f571a 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/datastax/terraform-provider-astra/v2 -go 1.18 +go 1.20 require ( github.com/datastax/astra-client-go/v2 v2.2.51 diff --git a/internal/provider/provider_framework.go b/internal/provider/provider_framework.go index d2426963..6c535a84 100644 --- a/internal/provider/provider_framework.go +++ b/internal/provider/provider_framework.go @@ -148,8 +148,11 @@ func (p *astraProvider) Configure(ctx context.Context, req provider.ConfigureReq if strings.HasSuffix(streamingAPIServerURL, "/") { pulsarAdminPath = strings.TrimPrefix(pulsarAdminPath, "/") } - // TODO: when we switch to go 1.19, this should use url.JoinPath - streamingAPIServerURLPulsarAdmin := streamingAPIServerURL + pulsarAdminPath + streamingAPIServerURLPulsarAdmin, err := url.JoinPath(streamingAPIServerURL, pulsarAdminPath) + if err != nil { + resp.Diagnostics.AddError("failed to create Pulsar admin server API URL", err.Error()) + return + } if _, err := url.Parse(streamingAPIServerURLPulsarAdmin); err != nil { resp.Diagnostics.AddError("invalid Pulsar admin server API URL", err.Error()) return