Repository navigation
fix(read): preserve the int64 range on 32-bit systems - #228
Merged
Merged
Conversation
inhere
added a commit
that referenced
this pull request
Oct 23, 2026
- Int/Uint record an error instead of silently wrapping when the int64 value is out of the platform int/uint range. This also fixes the two go/incorrect-integer-conversion alerts CodeQL reports on #228. - the platform int/uint range is checked with the math.MaxInt/MinInt/MaxUint constants, so the 64-bit behavior is unchanged. - move the 32-bit range tests into read_int_test.go, use goutil/x/assert and cover Int64, Duration, Int and Uint.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Int64passes a bit size of zero tostrconv.ParseInt, which uses the native int width. On 32-bit systems, reading2147483648returns2147483647and records a range error.Parse explicitly as 64 bits. Regression tests cover values just outside the int32 range and both int64 limits.
go test -cover ./...passes on Windows amd64 and 386. Build and formatting checks pass; existing lint findings are unchanged.