-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Open
Description
Proposal Details
We currently have "int" case handled with strconv.Atoi and strconv.Itoa.
In my practice it is not unexpected to need the same for int8, … int64 and all kinds of uints.
I propose to introduce the following functions:
| type | convert to string | parse from string |
|---|---|---|
| int8 | strconv.Itoa8 | strconv.Atoi8 |
| int16 | strconv.Itoa16 | strconv.Atoi16 |
| int32 | strconv.Itoa32 | strconv.Atoi32 |
| int64 | strconv.Itoa64 | strconv.Atoi64 |
| uint | strconv.Utoa | strconv.Atou |
| uint8 | strconv.Utoa8 | strconv.Atou8 |
| uint16 | strconv.Utoa16 | strconv.Atou16 |
| uint32 | strconv.Utoa32 | strconv.Atou32 |
| uint64 | strconv.Utoa64 | strconv.Atou64 |
With trivial implementation probably made as strconv.ParseInt(x, 10, 32) wrapper for strconv.Atoi32.
chad-bekmezian-snap and jfrech