Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a Go module dependency issue by removing the patch version from the Go version directive in go.mod. The change prevents go mod tidy from potentially downgrading or changing users' toolchain instructions.
- Updates Go version directive from
1.21.0to1.21to follow Go module best practices
| module github.com/spf13/cast | ||
|
|
||
| go 1.21.0 | ||
| go 1.21 |
There was a problem hiding this comment.
Good fix! The Go version directive in go.mod should specify only major.minor versions (e.g., 1.21) rather than including patch versions (e.g., 1.21.0). This follows Go module best practices and prevents toolchain version conflicts during 'go mod tidy' operations.
|
@spf13 @sagikazarmark please review ,thanks |
|
I'm not entirely sure why this is necessary. As of Go 1.21, that's the correct notation: https://go.dev/doc/go1.21#tools (In fact, as of Go 1.23 it's the only accepted notation) It declares a minimum required version, so as longs you have something later in your toolchain, it shouldn't cause any issues. Can you please show me an example where it causes trouble? Thanks! |
minor version declaration cause problem when user go mod tidy;
it will downgrade or change user's toolchain instruction and mess up dependencies