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

go.mod: bump to Go 1.20 #1052

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tklauser
Copy link
Contributor

PR #1038 started using net.FlagRunning which was introduced in Go 1.20, see https://go.dev/doc/go1.20#netpkgnet. Bump the minimum required Go version in go.mod accordingly and run go mod tidy.

PR vishvananda#1038 started using
net.FlagRunning which was introduced in Go 1.20, see
https://go.dev/doc/go1.20#netpkgnet. Bump the minimum required Go
version in go.mod accordingly and run `go mod tidy`.
@thaJeztah
Copy link
Contributor

I guess, if we wanted to keep compatibility with go < 1.20, the alternative would be to define net.FlagRunning in a //go:build !go1.20 file? (it's only the FlagRunning const that's missing?

@aboch @akerouanton for #1038, do you think it would make sense to have a "pre-go1.20" file?

@akerouanton
Copy link
Contributor

PR #1049 bumped the version of Go used on GHA to v1.22, so I guess it'd make sense to bump the minimum Go version to v1.22.

If this looks too drastic to @aboch, we should probably downgrade the version used on GHA to keep it aligned with go.mod.

@thaJeztah
Copy link
Contributor

PR #1049 bumped the version of Go used on GHA to v1.22, so I guess it'd make sense to bump the minimum Go version to v1.22.

No, I don't think we should aggressively update the minimum version, because we know this module is used in many projects (either as a direct, or indirect dependency). For such modules, we should try to keep the requirements as low as possible. Given, go1.12 as minimum is really low (but if nothing in this module requires anything more recent, then that's perfectly fine).

I think the correct approach (more so, because CI on this repository runs really fast) would be to change to using a matrix in GitHub actions) to test against;

  • minimum version specified in go.mod (i.e., verify what we advertise as minimum required version to actually work)
  • actively supported go versions (stable, oldstable (latest + latest -1))

We could test all versions in between (with CI being reasonably short), but that may be a bit much.

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