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

Consider updating declared Go version in go.mod #1313

Closed
JackMordaunt opened this issue Dec 14, 2022 · 2 comments
Closed

Consider updating declared Go version in go.mod #1313

JackMordaunt opened this issue Dec 14, 2022 · 2 comments
Labels
Breaking Change dependencies Pull requests that update a dependency file go Pull requests that update Go code

Comments

@JackMordaunt
Copy link

The go.mod file declares go 1.13 right now. Module graph pruning was added in Go 1.17, meaning that other modules can import your module and only pick up the transitive dependencies that are actually reachable based on how they use your code. Right now, importing testify means importing a yaml parser because the declared go version predates go 1.17.

The tidiest dependency graph will come from using go 1.18, as:

The go.sum file recorded by go mod tidy for a module by default includes checksums needed by the Go version one below the version specified in its go directive. So a go 1.17 module includes checksums needed for the full module graph loaded by Go 1.16, but a go 1.18 module will include only the checksums needed for the pruned module graph loaded by Go 1.17. The -compat flag can be used to override the default version (for example, to prune the go.sum file more aggressively in a go 1.17 module).

Go 1.18 is also the oldest Go release still supported by the Go team, so it's a reasonable choice of language version to declare.

@brackendawson
Copy link
Collaborator

brackendawson commented Dec 19, 2022

Because of

unless that version of the module is also (transitively) required by some other dependency at go 1.16 or below

and because https://github.com/stretchr/objx requires testify at 1.13, objx would need to be updated first.

@dolmen dolmen added Breaking Change dependencies Pull requests that update a dependency file go Pull requests that update Go code labels Jul 25, 2023
@dolmen
Copy link
Collaborator

dolmen commented Mar 19, 2024

Testify is a pillar in the Go ecosystem. As a maintainer I don't want to block users from upgrading Testify while they are locked on an older version of Go (for example for the support of a legacy GOOS or GOARCH).

So we will only upgrade the Go version only if necessary.

The minimum Go version currently declared in go.mod is 1.17. I don't see a need for an increase for now.

@dolmen dolmen closed this as not planned Won't fix, can't repro, duplicate, stale Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking Change dependencies Pull requests that update a dependency file go Pull requests that update Go code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants