diff --git a/.github/workflows/dapr_cli.yaml b/.github/workflows/dapr_cli.yaml index 052ca84e..2a553c0c 100644 --- a/.github/workflows/dapr_cli.yaml +++ b/.github/workflows/dapr_cli.yaml @@ -29,7 +29,6 @@ jobs: name: Build ${{ matrix.target_os }}_${{ matrix.target_arch }} binaries runs-on: ${{ matrix.os }} env: - GOVER: 1.19.6 GOLANG_CI_LINT_VER: v1.51.2 GOOS: ${{ matrix.target_os }} GOARCH: ${{ matrix.target_arch }} @@ -57,12 +56,13 @@ jobs: - os: macOS-latest target_arch: arm steps: - - name: Set up Go ${{ env.GOVER }} - uses: actions/setup-go@v3 - with: - go-version: ${{ env.GOVER }} - name: Check out code into the Go module directory uses: actions/checkout@v3 + - name: Set up Go + uses: actions/setup-go@v3 + id: setup-go + with: + go-version-file: 'go.mod' - name: Cache Go modules (Linux) if: matrix.target_os == 'linux' uses: actions/cache@v3 @@ -70,9 +70,9 @@ jobs: path: | ~/.cache/go-build ~/go/pkg/mod - key: ${{ matrix.target_os }}-${{ matrix.target_arch }}-go-${{ env.GOVER }}-${{ hashFiles('**/go.sum') }} + key: ${{ matrix.target_os }}-${{ matrix.target_arch }}-go-${{ steps.setup-go.outputs.go-version }}-${{ hashFiles('**/go.sum') }} restore-keys: | - ${{ matrix.target_os }}-${{ matrix.target_arch }}-go-${{ env.GOVER }}- + ${{ matrix.target_os }}-${{ matrix.target_arch }}-go-${{ steps.setup-go.outputs.go-version }}- - name: Cache Go modules (Windows) if: matrix.target_os == 'windows' uses: actions/cache@v3 @@ -80,9 +80,9 @@ jobs: path: | ~\AppData\Local\go-build ~\go\pkg\mod - key: ${{ matrix.target_os }}-${{ matrix.target_arch }}-go-${{ env.GOVER }}-${{ hashFiles('**/go.sum') }} + key: ${{ matrix.target_os }}-${{ matrix.target_arch }}-go-${{ steps.setup-go.outputs.go-version }}-${{ hashFiles('**/go.sum') }} restore-keys: | - ${{ matrix.target_os }}-${{ matrix.target_arch }}-go-${{ env.GOVER }}- + ${{ matrix.target_os }}-${{ matrix.target_arch }}-go-${{ steps.setup-go.outputs.go-version }}- - name: Cache Go modules (macOS) if: matrix.target_os == 'darwin' uses: actions/cache@v3 @@ -90,9 +90,9 @@ jobs: path: | ~/Library/Caches/go-build ~/go/pkg/mod - key: ${{ matrix.target_os }}-${{ matrix.target_arch }}-go-${{ env.GOVER }}-${{ hashFiles('**/go.sum') }} + key: ${{ matrix.target_os }}-${{ matrix.target_arch }}-go-${{ steps.setup-go.outputs.go-version }}-${{ hashFiles('**/go.sum') }} restore-keys: | - ${{ matrix.target_os }}-${{ matrix.target_arch }}-go-${{ env.GOVER }}- + ${{ matrix.target_os }}-${{ matrix.target_arch }}-go-${{ steps.setup-go.outputs.go-version }}- - name: Run golangci-lint if: matrix.target_arch == 'amd64' && matrix.target_os == 'linux' uses: golangci/golangci-lint-action@v3.2.0 diff --git a/.github/workflows/kind_e2e.yaml b/.github/workflows/kind_e2e.yaml index 624698a8..5f7afadb 100644 --- a/.github/workflows/kind_e2e.yaml +++ b/.github/workflows/kind_e2e.yaml @@ -50,7 +50,6 @@ jobs: name: E2E tests for K8s (KinD) runs-on: ubuntu-latest env: - GOVER: 1.19.6 DAPR_RUNTIME_PINNED_VERSION: 1.10.0 DAPR_DASHBOARD_PINNED_VERSION: 0.12.0 DAPR_RUNTIME_LATEST_STABLE_VERSION: @@ -80,23 +79,24 @@ jobs: kind-version: v0.16.0 kind-image-sha: sha256:9be91e9e9cdf116809841fc77ebdb8845443c4c72fe5218f3ae9eb57fdb4bace steps: - - name: Set up Go ${{ env.GOVER }} - uses: actions/setup-go@v3 - with: - go-version: ${{ env.GOVER }} - name: Check out code onto GOPATH uses: actions/checkout@v3 with: path: ./src/github.com/dapr/cli + - name: Set up Go + uses: actions/setup-go@v3 + id: setup-go + with: + go-version-file: './src/github.com/dapr/cli/go.mod' - name: Cache Go modules uses: actions/cache@v3 with: path: | ~/.cache/go-build ~/go/pkg/mod - key: ${{ matrix.k8s-version }}-${{ matrix.kind-version }}-go-${{ env.GOVER }}-${{ hashFiles('**/go.sum') }} + key: ${{ matrix.k8s-version }}-${{ matrix.kind-version }}-go-${{ steps.setup-go.outputs.go-version }}-${{ hashFiles('**/go.sum') }} restore-keys: | - ${{ matrix.k8s-version }}-${{ matrix.kind-version }}-go-${{ env.GOVER }}- + ${{ matrix.k8s-version }}-${{ matrix.kind-version }}-go-${{ steps.setup-go.outputs.go-version }}- - name: Configure KinD # Generate a KinD configuration file that uses: diff --git a/.github/workflows/self_hosted_e2e.yaml b/.github/workflows/self_hosted_e2e.yaml index a05f6df6..799b5683 100644 --- a/.github/workflows/self_hosted_e2e.yaml +++ b/.github/workflows/self_hosted_e2e.yaml @@ -35,7 +35,6 @@ jobs: name: Run Self-Hosted E2E tests in ${{ matrix.target_os }}_${{ matrix.target_arch }}_${{ matrix.dapr_install_mode }} runs-on: ${{ matrix.os }} env: - GOVER: 1.19.6 GOOS: ${{ matrix.target_os }} GOARCH: ${{ matrix.target_arch }} GOPROXY: https://proxy.golang.org @@ -60,12 +59,13 @@ jobs: - os: windows-latest dapr_install_mode: complete steps: - - name: Set up Go ${{ env.GOVER }} - uses: actions/setup-go@v3 - with: - go-version: ${{ env.GOVER }} - name: Check out code into the Go module directory uses: actions/checkout@v3 + - name: Set up Go + uses: actions/setup-go@v3 + id: setup-go + with: + go-version-file: 'go.mod' - name: Cache Go modules (Linux) if: matrix.target_os == 'linux' uses: actions/cache@v3 @@ -73,9 +73,9 @@ jobs: path: | ~/.cache/go-build ~/go/pkg/mod - key: ${{ matrix.target_os }}-${{ matrix.target_arch }}-go-${{ env.GOVER }}-${{ hashFiles('**/go.sum') }} + key: ${{ matrix.target_os }}-${{ matrix.target_arch }}-go-${{ steps.setup-go.outputs.go-version }}-${{ hashFiles('**/go.sum') }} restore-keys: | - ${{ matrix.target_os }}-${{ matrix.target_arch }}-go-${{ env.GOVER }}- + ${{ matrix.target_os }}-${{ matrix.target_arch }}-go-${{ steps.setup-go.outputs.go-version }}- - name: Cache Go modules (Windows) if: matrix.target_os == 'windows' uses: actions/cache@v3 @@ -83,9 +83,9 @@ jobs: path: | ~\AppData\Local\go-build ~\go\pkg\mod - key: ${{ matrix.target_os }}-${{ matrix.target_arch }}-go-${{ env.GOVER }}-${{ hashFiles('**/go.sum') }} + key: ${{ matrix.target_os }}-${{ matrix.target_arch }}-go-${{ steps.setup-go.outputs.go-version }}-${{ hashFiles('**/go.sum') }} restore-keys: | - ${{ matrix.target_os }}-${{ matrix.target_arch }}-go-${{ env.GOVER }}- + ${{ matrix.target_os }}-${{ matrix.target_arch }}-go-${{ steps.setup-go.outputs.go-version }}- - name: Cache Go modules (macOS) if: matrix.target_os == 'darwin' uses: actions/cache@v3 @@ -93,9 +93,9 @@ jobs: path: | ~/Library/Caches/go-build ~/go/pkg/mod - key: ${{ matrix.target_os }}-${{ matrix.target_arch }}-go-${{ env.GOVER }}-${{ hashFiles('**/go.sum') }} + key: ${{ matrix.target_os }}-${{ matrix.target_arch }}-go-${{ steps.setup-go.outputs.go-version }}-${{ hashFiles('**/go.sum') }} restore-keys: | - ${{ matrix.target_os }}-${{ matrix.target_arch }}-go-${{ env.GOVER }}- + ${{ matrix.target_os }}-${{ matrix.target_arch }}-go-${{ steps.setup-go.outputs.go-version }}- - name: Install podman - MacOS if: matrix.os == 'macos-latest' && matrix.dapr_install_mode == 'complete' run: | diff --git a/.github/workflows/upgrade_e2e.yaml b/.github/workflows/upgrade_e2e.yaml index d449a504..fefc9570 100644 --- a/.github/workflows/upgrade_e2e.yaml +++ b/.github/workflows/upgrade_e2e.yaml @@ -49,8 +49,6 @@ jobs: kubernetes-e2e: name: Upgrade path tests (KinD) runs-on: ubuntu-latest - env: - GOVER: 1.19.6 strategy: fail-fast: false # Keep running if one leg fails. matrix: @@ -75,23 +73,24 @@ jobs: kind-version: v0.16.0 kind-image-sha: sha256:9be91e9e9cdf116809841fc77ebdb8845443c4c72fe5218f3ae9eb57fdb4bace steps: - - name: Set up Go ${{ env.GOVER }} - uses: actions/setup-go@v3 - with: - go-version: ${{ env.GOVER }} - name: Check out code onto GOPATH uses: actions/checkout@v3 with: path: ./src/github.com/dapr/cli + - name: Set up Go + uses: actions/setup-go@v3 + id: setup-go + with: + go-version-file: './src/github.com/dapr/cli/go.mod' - name: Cache Go modules uses: actions/cache@v3 with: path: | ~/.cache/go-build ~/go/pkg/mod - key: ${{ matrix.k8s-version }}-${{ matrix.kind-version }}-go-${{ env.GOVER }}-${{ hashFiles('**/go.sum') }} + key: ${{ matrix.k8s-version }}-${{ matrix.kind-version }}-go-${{ steps.setup-go.outputs.go-version }}-${{ hashFiles('**/go.sum') }} restore-keys: | - ${{ matrix.k8s-version }}-${{ matrix.kind-version }}-go-${{ env.GOVER }}- + ${{ matrix.k8s-version }}-${{ matrix.kind-version }}-go-${{ steps.setup-go.outputs.go-version }}- - name: Configure KinD diff --git a/Makefile b/Makefile index 90df0ea3..8e2b1ff0 100644 --- a/Makefile +++ b/Makefile @@ -200,7 +200,7 @@ e2e-build-run-sh: build test-e2e-sh ################################################################################ .PHONY: modtidy modtidy: - go mod tidy -compat=1.19 + go mod tidy -compat=1.20 ################################################################################ # Target: check-diff # diff --git a/docs/development/development.md b/docs/development/development.md index 210a5537..c4e0b187 100644 --- a/docs/development/development.md +++ b/docs/development/development.md @@ -7,7 +7,7 @@ This document helps you get started developing Dapr CLI. If you find any problem ### Linux and MacOS -1. The Go language environment `1.19` [(instructions)](https://golang.org/doc/install#tarball). +1. The Go language environment `1.20` [(instructions)](https://golang.org/doc/install#tarball). * Make sure that your GOPATH and PATH are configured correctly ```bash export GOPATH=~/go diff --git a/go.mod b/go.mod index 206578d4..8dc4e115 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/dapr/cli -go 1.19 +go 1.20 require ( github.com/Azure/go-autorest/autorest v0.11.28 // indirect diff --git a/pkg/standalone/uninstall.go b/pkg/standalone/uninstall.go index 11fe166e..29fee9b6 100644 --- a/pkg/standalone/uninstall.go +++ b/pkg/standalone/uninstall.go @@ -113,8 +113,7 @@ func Uninstall(uninstallAll bool, dockerNetwork string, containerRuntime string, // TODO move to use errors.Join once we move to go 1.20. for _, e := range containerErrs { - // For 1.19 only one %w is allowed. - err = fmt.Errorf("%w \n %s", err, e) //nolint: errorlint + err = fmt.Errorf("%w \n %w", err, e) } return err } diff --git a/tests/apps/emit-metrics/go.mod b/tests/apps/emit-metrics/go.mod index 2b114ab2..1d7104a2 100644 --- a/tests/apps/emit-metrics/go.mod +++ b/tests/apps/emit-metrics/go.mod @@ -1,3 +1,3 @@ module emit-metrics -go 1.19 +go 1.20 diff --git a/tests/apps/processor/go.mod b/tests/apps/processor/go.mod index 116fdbb5..b0d71564 100644 --- a/tests/apps/processor/go.mod +++ b/tests/apps/processor/go.mod @@ -1,3 +1,3 @@ module processor -go 1.19 +go 1.20