Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade go version to 1.20 #1246

Merged
merged 7 commits into from
Mar 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions .github/workflows/dapr_cli.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -57,42 +56,43 @@ 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
with:
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
with:
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
with:
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
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/kind_e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/self_hosted_e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -60,42 +59,43 @@ 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
with:
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
with:
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
with:
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: |
Expand Down
15 changes: 7 additions & 8 deletions .github/workflows/upgrade_e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
mukundansundar marked this conversation as resolved.
Show resolved Hide resolved

################################################################################
# Target: check-diff #
Expand Down
2 changes: 1 addition & 1 deletion docs/development/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
mukundansundar marked this conversation as resolved.
Show resolved Hide resolved
* Make sure that your GOPATH and PATH are configured correctly
```bash
export GOPATH=~/go
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 1 addition & 2 deletions pkg/standalone/uninstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion tests/apps/emit-metrics/go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module emit-metrics

go 1.19
go 1.20
2 changes: 1 addition & 1 deletion tests/apps/processor/go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module processor

go 1.19
go 1.20