Documentation
¶
Index ¶
- Variables
- func ToInt[T Number](i T) (int, error)
- func ToInt8[T Number](i T) (int8, error)
- func ToInt16[T Number](i T) (int16, error)
- func ToInt32[T Number](i T) (int32, error)
- func ToInt64[T Number](i T) (int64, error)
- func ToUint[T Number](i T) (uint, error)
- func ToUint8[T Number](i T) (uint8, error)
- func ToUint16[T Number](i T) (uint16, error)
- func ToUint32[T Number](i T) (uint32, error)
- func ToUint64[T Number](i T) (uint64, error)
- type Number
Constants ¶
This section is empty.
Variables ¶
var ErrOutOfRange = errors.New("out of range")
Functions ¶
func ToInt ¶
ToInt attempts to convert any Number value to an int. If the conversion results in a value outside the range of an int, an ErrOutOfRange error is returned.
func ToInt8 ¶
ToInt8 attempts to convert any Number value to an int8. If the conversion results in a value outside the range of an int8, an ErrOutOfRange error is returned.
func ToInt16 ¶
ToInt16 attempts to convert any Number value to an int16. If the conversion results in a value outside the range of an int16, an ErrOutOfRange error is returned.
func ToInt32 ¶
ToInt32 attempts to convert any Number value to an int32. If the conversion results in a value outside the range of an int32, an ErrOutOfRange error is returned.
func ToInt64 ¶
ToInt64 attempts to convert any Number value to an int64. If the conversion results in a value outside the range of an int64, an ErrOutOfRange error is returned.
func ToUint ¶
ToUint attempts to convert any Number value to an uint. If the conversion results in a value outside the range of an uint, an ErrOutOfRange error is returned.
func ToUint8 ¶
ToUint8 attempts to convert any Number value to an uint8. If the conversion results in a value outside the range of an uint8, an ErrOutOfRange error is returned.
func ToUint16 ¶
ToUint16 attempts to convert any Number value to an uint16. If the conversion results in a value outside the range of an uint16, an ErrOutOfRange error is returned.