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: no way to ParseFloat / ParseInt from []byte #3197

Closed
bradfitz opened this issue Mar 5, 2012 · 3 comments
Closed

strconv: no way to ParseFloat / ParseInt from []byte #3197

bradfitz opened this issue Mar 5, 2012 · 3 comments

Comments

@bradfitz
Copy link
Contributor

bradfitz commented Mar 5, 2012

The strconv package's ParseFloat / ParseInt only take string.

To reduce allocations, I need to parse an int from a []byte.

I attempted to convert strconv's Parse internals to use []byte instead, and then make
the existing string versions make an unsafe []byte of the string's memory using
reflect.SliceHeader / reflect.StringHeader, but the reflect package already depends on
strconv, so there's an import loop.
@remyoudompheng
Copy link
Contributor

Comment 1:

This is also issue #2632, I guess.

@rsc
Copy link
Contributor

rsc commented Mar 5, 2012

Comment 2:

Labels changed: added priority-later, removed priority-triage.

Status changed to Thinking.

@bradfitz
Copy link
Contributor Author

bradfitz commented Mar 5, 2012

Comment 3:

Status changed to Duplicate.

Merged into issue #2632.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants