Documentation
¶
Overview ¶
Package atoi provides integer parsing functions optimized specifically for jscan since the parser validates the input before the integer parser is invoked.
WARNING: These functions are not a replacement for strconv.ParseInt or strconv.Atoi because they don't validate the input and assumes valid input instead. The jscan tokenizer is guaranteed to provide only valid values which are only not guaranteed to not overflow.
Index ¶
- func I16[S []byte | string](s S) (n int16, overflow bool)
- func I32[S []byte | string](s S) (n int32, overflow bool)
- func I64[S []byte | string](s S) (n int64, overflow bool)
- func I8[S []byte | string](s S) (n int8, overflow bool)
- func U16[S []byte | string](s S) (n uint16, overflow bool)
- func U32[S []byte | string](s S) (n uint32, overflow bool)
- func U64[S []byte | string](s S) (n uint64, overflow bool)
- func U8[S []byte | string](s S) (n uint8, overflow bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func I16 ¶
I16 assumes that s is a valid 16-bit signed or unsigned integer (where only '-' is accepted). Returns (0, true) if the value would overflow.
func I32 ¶
I32 assumes that s is a valid 32-bit signed or unsigned integer (where only '-' is accepted). Returns (0, true) if the value would overflow.
func I64 ¶
I64 assumes that s is a valid 64-bit signed or unsigned integer (where only '-' is accepted). Returns (0, true) if the value would overflow.
func I8 ¶
I8 assumes that s is a valid 8-bit signed or unsigned integer (where only '-' is accepted). Returns (0, true) if the value would overflow.
func U16 ¶
U16 assumes that s is a valid unsigned 16-bit integer. Returns (0, true) if the value would overflow.
func U32 ¶
U32 assumes that s is a valid unsigned 32-bit integer. Returns (0, true) if the value would overflow.
Types ¶
This section is empty.