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

Require Go 1.21 #149

Merged
merged 1 commit into from
Aug 11, 2023
Merged

Require Go 1.21 #149

merged 1 commit into from
Aug 11, 2023

Conversation

mndrix
Copy link
Contributor

@mndrix mndrix commented Aug 10, 2023

Commit f024fca uses math/big.Int.Float64 which was introduced in Go version 1.21

Commit f024fca uses math/big.Int.Float64 which was introduced in Go
version 1.21
@dmitshur
Copy link
Contributor

dmitshur commented Aug 10, 2023

Note that right now, Go 1.21 and Go 1.20 are the two major Go releases supported per the Go release policy. Go 1.20.x will be supported for another 6 months or so until Go 1.22.0 comes out.

Setting the go line to 1.21 makes that the minimum required version for this module, meaning Go users who haven't yet upgraded from Go 1.20 to 1.21 will not be able to import the latest versions of packages from this module, not unless they too upgrade their module to require 1.21.

Perhaps that's fine, just wanted to point this out.

An alternative to consider is to keep the go.mod go line at a lower version (like 1.20) and use a //go:build go1.21 build constraint in .go files that need it, and //go:build !go1.20 that provides a fallback implementation for Go 1.20 and older. (Edit: See PR #152 that illustrates this idea.)

@mndrix
Copy link
Contributor Author

mndrix commented Aug 10, 2023

Point taken. Since Rob used Float64, I assumed the 1.21 dependency was intentional. If not, I withdraw the PR.

@robpike
Copy link
Owner

robpike commented Aug 11, 2023

This particular result was not intentional, but I was planning to move to 1.21 pretty soon. Might as well do it now!

@robpike robpike merged commit 5f934e0 into robpike:master Aug 11, 2023
robpike added a commit that referenced this pull request Aug 11, 2023
@robpike robpike mentioned this pull request Aug 11, 2023
robpike added a commit that referenced this pull request Aug 11, 2023
@mndrix mndrix deleted the mod-1.21 branch August 11, 2023 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants