Documentation
¶
Overview ¶
Package converters provides safe type conversion functions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNegativeValue = ewrap.New("negative values cannot be converted to unsigned integers")
ErrNegativeValue is returned when attempting to convert a negative number to an unsigned type.
Functions ¶
func SafeIntFromInt64 ¶
SafeIntFromInt64 converts an int64 to int, ensuring the value fits in the target type.
func SafeUint64FromInt ¶
SafeUint64FromInt converts an int to uint64 while guarding against negative values and overflow.
func SafeUint64FromInt64 ¶
SafeUint64FromInt64 converts an int64 to uint64 while guarding against negative values.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.