Documentation
¶
Index ¶
- Variables
- func ToInt[T Type](i T) (int, error)
- func ToInt8[T Type](i T) (int8, error)
- func ToInt16[T Type](i T) (int16, error)
- func ToInt32[T Type](i T) (int32, error)
- func ToInt64[T Type](i T) (int64, error)
- func ToUint[T Type](i T) (uint, error)
- func ToUint8[T Type](i T) (uint8, error)
- func ToUint16[T Type](i T) (uint16, error)
- func ToUint32[T Type](i T) (uint32, error)
- func ToUint64[T Type](i T) (uint64, error)
- type Float
- type Integer
- type Number
- type Signed
- type Type
- type Unsigned
Constants ¶
This section is empty.
Variables ¶
var ErrConversionIssue = errors.New("conversion issue")
Functions ¶
func ToInt ¶
ToInt attempts to convert any Type value to an int. If the conversion results in a value outside the range of an int, an ErrConversionOverflow error is returned.
func ToInt8 ¶
ToInt8 attempts to convert any Type value to an int8. If the conversion results in a value outside the range of an int8, an ErrConversionOverflow error is returned.
func ToInt16 ¶
ToInt16 attempts to convert any Type value to an int16. If the conversion results in a value outside the range of an int16, an ErrConversionOverflow error is returned.
func ToInt32 ¶
ToInt32 attempts to convert any Type value to an int32. If the conversion results in a value outside the range of an int32, an ErrConversionOverflow error is returned.
func ToInt64 ¶
ToInt64 attempts to convert any Type value to an int64. If the conversion results in a value outside the range of an int64, an ErrConversionOverflow error is returned.
func ToUint ¶
ToUint attempts to convert any Type value to an uint. If the conversion results in a value outside the range of an uint, an ErrConversionOverflow error is returned.
func ToUint8 ¶
ToUint8 attempts to convert any Type value to an uint8. If the conversion results in a value outside the range of an uint8, an ErrConversionOverflow error is returned.
func ToUint16 ¶
ToUint16 attempts to convert any Type value to an uint16. If the conversion results in a value outside the range of an uint16, an ErrConversionOverflow error is returned.
Types ¶
type Number ¶
Number is an alias for all integers and floats TODO: consider using complex, but not sure there is a need
type Signed ¶ added in v1.1.0
Signed is an alias for all signed integers: int, int8, int16, int32, and int64 types.
