Fixed version number discrepancy #4299
Merged
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.
Fix mismatch between Go version check logic and warning message
Problem
There is a mismatch between the Go version check logic and the warning message shown to users:
const ginSupportMinGoVer = 21
"[WARNING] Now Gin requires Go 1.23+\n"
As a result, users running Go 1.21 or 1.22 cannot see the warning, even though the message states that 1.23+ is required.
Cause
The logic in
debugPrintWARNINGDefault()
:With ginSupportMinGoVer = 21, however, users on Go 1.21 (v = 21) or 1.22 (v = 22) don't trigger the warning (v < 21 is false).
Fix
Update the constant ginSupportMinGoVer to 23 to match the warning message indicating that Go 1.23+ is required.
This ensures users running Go versions below 1.23 will properly receive the warning,
aligning behavior with messaging.