Skip to content

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

@neild

Description

@neild

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues describing a change to documentation.FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions