You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Force appropriate version for go mod tidy compatibility check
`go mod tidy` has an inexplicable default behavior:
https://go.dev/ref/mod#go-mod-tidy
>By default, go mod tidy will check that the selected versions of modules do not change when the module graph is loaded
> by the Go version immediately preceding the version indicated in the go directive.
The `go` directive indicates the version of Go the project is written for. The `go mod tidy` command should not fail if
the module is configured in a manner that is incompatible with an unsupported Go version.
So it is necessary use use the `-compat=1.17` flag to cause the `go mod tidy` command to behave correctly and check for
compatibility with the version of Go that is in use.
Previously, I had thought that `go mod tidy` was straightforward enough that it did not make sense to wrap it in a task.
This is no longer true, so it is moved to the `go:tidy` task so that the developer does not need to think about what
obscure flags are required to make it behave correctly and to be aligned with the results of the "Check Go" CI workflow.
0 commit comments