From ce722ed270dfadf51aa97cd2bd0371eb3db25c86 Mon Sep 17 00:00:00 2001 From: Michael Hoffmann Date: Wed, 1 Feb 2023 22:50:51 +0100 Subject: [PATCH 1/5] ci: Add Go 1.20 --- .github/workflows/lint.yml | 2 +- .github/workflows/test.yml | 8 ++++---- go.mod | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 9af58ec53..02ef3528f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -20,7 +20,7 @@ jobs: steps: - uses: actions/setup-go@v3 with: - go-version: "1.19" + go-version: "1.20" - uses: actions/checkout@v3 - name: golangci-lint uses: golangci/golangci-lint-action@v3 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c037c2c40..c80fb3df9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -46,8 +46,8 @@ jobs: - name: Vet run: go vet ./... - name: Check go.mod Tidiness - run: go mod tidy -go=1.19 -compat=1.17 && git diff --exit-code - if: ${{ matrix.go == '1.19' }} + run: go mod tidy -go=1.20 -compat=1.17 && git diff --exit-code + if: ${{ matrix.go == '1.20' }} - name: Test run: make test - name: Test (with race detection) @@ -56,7 +56,7 @@ jobs: # pull requests, only run this step for a single job in the matrix. For # all other workflow triggers (e.g., pushes to a release branch) run # this step for the whole matrix. - if: ${{ github.event_name != 'pull_request' || (matrix.go == '1.19' && matrix.os == 'ubuntu') }} + if: ${{ github.event_name != 'pull_request' || (matrix.go == '1.20' && matrix.os == 'ubuntu') }} - name: Collect coverage run: make test-coverage - name: Upload coverage to Codecov @@ -66,7 +66,7 @@ jobs: timeout-minutes: 10 strategy: matrix: - go: ["1.19", "1.18", "1.17"] + go: ["1.20", "1.19", "1.18", "1.17"] os: [ubuntu, windows, macos] fail-fast: false # Test the GOPATH mode with the oldest Go version we support diff --git a/go.mod b/go.mod index e96d2f37b..0843de459 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/getsentry/sentry-go -go 1.19 +go 1.20 require ( github.com/gin-gonic/gin v1.8.1 From 66ea28333fdde5126b2baa942ac68625f344cd79 Mon Sep 17 00:00:00 2001 From: Michael Hoffmann Date: Thu, 16 Feb 2023 14:00:31 +0100 Subject: [PATCH 2/5] Use golangci-lint 1.51 --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 02ef3528f..bc89c4906 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -25,6 +25,6 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: - version: v1.50 + version: v1.51 only-new-issues: true timeout-minutes: 10 From a2f6f0c58d7febad9e7bc6cf6d1d0456e2ba8dff Mon Sep 17 00:00:00 2001 From: Michael Hoffmann Date: Thu, 16 Feb 2023 14:10:25 +0100 Subject: [PATCH 3/5] Remove Go 1.17 --- .github/workflows/test.yml | 6 +++--- Makefile | 2 +- otel/internal/dummy/dummy.go | 9 --------- 3 files changed, 4 insertions(+), 13 deletions(-) delete mode 100644 otel/internal/dummy/dummy.go diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bd666a247..1af9d9c79 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -46,7 +46,7 @@ jobs: - name: Vet run: make vet - name: Check go.mod Tidiness - run: go mod tidy -go=1.20 -compat=1.17 && git diff --exit-code + run: make mod-tidy if: ${{ matrix.go == '1.20' }} - name: Test run: make test @@ -66,7 +66,7 @@ jobs: timeout-minutes: 10 strategy: matrix: - go: ["1.20", "1.19", "1.18", "1.17"] + go: ["1.20", "1.19", "1.18"] os: [ubuntu, windows, macos] fail-fast: false # Test the GOPATH mode with the oldest Go version we support @@ -86,7 +86,7 @@ jobs: steps: - uses: actions/setup-go@v3 with: - go-version: "1.17" + go-version: "1.18" - uses: actions/checkout@v3 with: path: ${{ env.WORKDIR }} diff --git a/Makefile b/Makefile index 5d3f8150e..7eeeddded 100644 --- a/Makefile +++ b/Makefile @@ -58,7 +58,7 @@ mod-tidy: ## Check go.mod tidiness for dir in $(ALL_GO_MOD_DIRS); do \ cd "$${dir}"; \ echo ">>> Running 'go mod tidy' for module: $${dir}"; \ - go mod tidy -go=1.19 -compat=1.17; \ + go mod tidy -go=1.20 -compat=1.18; \ done; \ git diff --exit-code; .PHONY: mod-tidy diff --git a/otel/internal/dummy/dummy.go b/otel/internal/dummy/dummy.go deleted file mode 100644 index 41d1a5415..000000000 --- a/otel/internal/dummy/dummy.go +++ /dev/null @@ -1,9 +0,0 @@ -package dummy - -// This package is intentionally left empty. -// Reason: the otel module currenty requires go>=1.18. All files in the module have '//go:build go1.18' guards, so -// with go1.17 "go test" might fail with the error: "go: warning: "./..." matched no packages; no packages to test". -// As a workaround, we added this empty "dummy" package, which is the only package without the compiler version restrictions, -// so at least the compiler doesn't complain that there are no packages to test. -// -// This file and package can be removed when we drop support for 1.17. From 3078de094b76955311844f6d95a83f6bc616e700 Mon Sep 17 00:00:00 2001 From: Michael Hoffmann Date: Thu, 16 Feb 2023 14:27:43 +0100 Subject: [PATCH 4/5] Set min version to 1.18 --- go.mod | 2 +- otel/go.mod | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index dc04f4813..5ce431802 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/getsentry/sentry-go -go 1.20 +go 1.18 require ( github.com/gin-gonic/gin v1.8.1 diff --git a/otel/go.mod b/otel/go.mod index 93e36a749..b86324330 100644 --- a/otel/go.mod +++ b/otel/go.mod @@ -1,6 +1,6 @@ module github.com/getsentry/sentry-go/otel -go 1.19 +go 1.18 require ( github.com/getsentry/sentry-go v0.18.0 From b8f9017f9862f54dc20452af0b88a57d08d1a47e Mon Sep 17 00:00:00 2001 From: Anton Ovchinnikov Date: Thu, 16 Feb 2023 17:43:33 +0100 Subject: [PATCH 5/5] Update Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7eeeddded..294a5470c 100644 --- a/Makefile +++ b/Makefile @@ -58,7 +58,7 @@ mod-tidy: ## Check go.mod tidiness for dir in $(ALL_GO_MOD_DIRS); do \ cd "$${dir}"; \ echo ">>> Running 'go mod tidy' for module: $${dir}"; \ - go mod tidy -go=1.20 -compat=1.18; \ + go mod tidy -go=1.18 -compat=1.18; \ done; \ git diff --exit-code; .PHONY: mod-tidy