Skip to content

fix: parse int and uint using the native integer width - #438

Open
jakezwang wants to merge 1 commit into
caarlos0:mainfrom
jakezwang:fix/native-integer-range
Open

jakezwang wants to merge 1 commit into
caarlos0:mainfrom
jakezwang:fix/native-integer-range

Conversation

@jakezwang

Copy link
Copy Markdown

The default int and uint parsers reject valid values above 32 bits even on 64-bit platforms. Use strconv.IntSize for these native types so parsing accepts their full range while still rejecting overflow.

Add public parsing tests for signed min/max, unsigned max and overflow, with expectations for both 32-bit and 64-bit platforms. Full make ci passes on Go 1.18.10, 1.26.6 and 1.27.1; the tests also cross-compile for Linux/386.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant