Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse 64bit number to uint64 #685

Open
DifferentialOrange opened this issue Feb 2, 2022 · 0 comments
Open

Parse 64bit number to uint64 #685

DifferentialOrange opened this issue Feb 2, 2022 · 0 comments
Labels
code health Improve code readability, simplify maintenance and so on

Comments

@DifferentialOrange
Copy link
Contributor

Strconv allows to call ParseUint for 32bit number instead of 64bit with third argument so it would be later converted to 32bit number:

res, err := strconv.ParseUint(str, 10, 32)

Since we use uint64 everywhere, it should be replaced with (str, 10, 64). Or numbers should be transformed to uint32 since version numbers are not likely to be greater than max uint32.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code health Improve code readability, simplify maintenance and so on
Projects
None yet
Development

No branches or pull requests

2 participants