Skip to content

Commit

Permalink
feat: require Go >= 1.20 (#392)
Browse files Browse the repository at this point in the history
This follows our Go version policy
https://github.com/hetznercloud/hcloud-go#go-version-support, but we
don't want to force an unjustified go version upgrade for users of this
library, so we only require go 1.20 instead of go 1.21.

The prometheus client_golang bumped the required go version to 1.20, we
need to follow to be able to upgrade this dependency:
#388
  • Loading branch information
jooola committed Mar 4, 2024
1 parent accbd7b commit 299f181
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
22 changes: 12 additions & 10 deletions .github/workflows/ci.yml
Expand Up @@ -24,20 +24,22 @@ jobs:
test:
strategy:
matrix:
go-version: ["1.19", "1.20", "1.21"]
go-version:
- "1.20"
- "1.21"

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}

- run: go test -coverprofile=coverage.txt -v -race ./...
- run: go test -coverprofile=coverage.txt -v -race ./...

- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}

generate:
runs-on: ubuntu-latest
Expand All @@ -53,4 +55,4 @@ jobs:
- run: git diff --exit-code

- if: failure()
run: echo "::error::Check failed, please run 'go generate ./...' and commit the changes."
run: echo "::error::Check failed, please run 'go generate ./...' and commit the changes."
2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -4,7 +4,7 @@ module github.com/hetznercloud/hcloud-go/v2
// all dependends to update to the new version.
// As long as we do not depend on any newer language feature this can be kept at the current value.
// It should never be higher than the lowest currently supported version of Go.
go 1.19
go 1.20

require (
github.com/google/go-cmp v0.6.0
Expand Down

0 comments on commit 299f181

Please sign in to comment.