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

strconv: document parsing of leading +, and interaction between sign and base prefix #46641

Closed
neild opened this issue Jun 7, 2021 · 1 comment
Labels
Documentation FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@neild
Copy link
Contributor

neild commented Jun 7, 2021

The strconv.ParseInt documentation does not state that a leading + is permitted in the input string. This seems worth mentioning.

The documentation states that the input string's prefix indicates the base when the base argument is 0, but does not state that the base prefix must follow the sign when present. (e.g., "-0xf", not "0x-f".) "The string's prefix" is not quite accurate; perhaps this should state "the string's prefix following the sign".

Possibly strconv.ParseUint should explicitly document that it does not accept a leading +.

Also, we don't seem to have any test coverage for leading + characters in ParseInt/ParseUint input.

@gopherbot
Copy link

Change https://golang.org/cl/325875 mentions this issue: strconv: document parsing of leading +/-

@cherrymui cherrymui added the NeedsFix The path to resolution is known, but the work has not been done. label Jun 8, 2021
@cherrymui cherrymui added this to the Backlog milestone Jun 8, 2021
@golang golang locked and limited conversation to collaborators Jun 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

3 participants