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

[release-1.3] Bump go toolchain to 1.22.6 #822

Merged
merged 3 commits into from
Aug 16, 2024
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
8 changes: 6 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ jobs:
;;
esac
- name: golangci-lint
uses: golangci/golangci-lint-action@08e2f20817b15149a52b5b3ebe7de50aff2ba8c5 # v3.4.0
uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # v6.1.0
with:
version: v1.60.1

test-windows:
strategy:
Expand Down Expand Up @@ -86,7 +88,9 @@ jobs:
esac
shell: bash
- name: golangci-lint
uses: golangci/golangci-lint-action@08e2f20817b15149a52b5b3ebe7de50aff2ba8c5 # v3.4.0
uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # v6.1.0
with:
version: v1.60.1

coverage:
needs: ["test-linux", "test-windows"]
Expand Down
2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.21.13
1.22.6
6 changes: 3 additions & 3 deletions db.go
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ func (db *DB) munmap() error {
// gofail: var unmapError string
// return errors.New(unmapError)
if err := munmap(db); err != nil {
return fmt.Errorf("unmap error: " + err.Error())
return fmt.Errorf("unmap error: %v", err.Error())
}

return nil
Expand Down Expand Up @@ -571,7 +571,7 @@ func (db *DB) munlock(fileSize int) error {
// gofail: var munlockError string
// return errors.New(munlockError)
if err := munlock(db, fileSize); err != nil {
return fmt.Errorf("munlock error: " + err.Error())
return fmt.Errorf("munlock error: %v", err.Error())
}
return nil
}
Expand All @@ -580,7 +580,7 @@ func (db *DB) mlock(fileSize int) error {
// gofail: var mlockError string
// return errors.New(mlockError)
if err := mlock(db, fileSize); err != nil {
return fmt.Errorf("mlock error: " + err.Error())
return fmt.Errorf("mlock error: %v", err.Error())
}
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module go.etcd.io/bbolt

go 1.21
go 1.22

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the requirement in this project to bump minimal go version to 1.22?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @crazy-max, the rationale is documented here!

Copy link

@crazy-max crazy-max Sep 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still not sure why. It should be the minimal required version for this module: https://go.dev/ref/mod#go-mod-file-go

The go directive sets the minimum version of Go required to use this module.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ivanvc please correct me if I am wrong.

The main idea is the support: Each major Go release is supported until there are two newer major releases. [1]. Thus, we are bumping the minimal required version to make sure we are not on the unsupported Go release.

Reference:
[1] https://go.dev/doc/devel/release

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @crazy-max, thanks for raising awareness of this. We have our Golang version usage documented in the etcd-io/etcd repository: https://github.com/etcd-io/etcd/blob/main/Documentation/contributor-guide/dependency_management.md#golang-versions.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Giving this a second thought. We may want to have a different policy for projects that are libraries like bbolt and raft. Should we consider staying on the oldest supported Go version until they drop support for it? @ahrtr WDYT?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

staying on the oldest supported Go version until they drop support for it

YES, that's the policy we have been following.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, my bad. I got confused with the minors.


toolchain go1.21.13
toolchain go1.22.6

require (
github.com/stretchr/testify v1.8.1
Expand Down
Loading