fix: improve handling of go directive version checks #16
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request updates the handling of Go version checks in
go.mod, especially around the "oldstable" version and patch version requirements. The changes clarify the behavior of thelaxinput, improve how patch versions are checked, and add new test cases to ensure correctness.Go version check logic improvements:
mod/mod.goto allowgo.modfiles without a patch version (e.g.,1.21) to pass if their major.minor matches the oldstable version, and to only require exact matches when a patch version is present.Documentation and configuration updates:
laxinput description inaction.ymlto indicate that it allows oldstable or older versions and only errors on stable versions.README.mdto show that omitting the patch version in the go directive is now considered OK if it matches oldstable, and added a new row for version1.20.Test coverage improvements:
mod/mod_test.goso that a minor-only version matching oldstable passes when not in lax mode.mod/mod_test.goto verify behavior for mismatched minor versions (no patch) and mismatched patch versions.