Documentation
¶
Index ¶
- Variables
- func NewEmptyInputError(targetType string) error
- func NewFormatError(value, targetType string) error
- func NewNegativeUintError(value any, targetType string) error
- func NewNotWholeError(value any) error
- func NewOverflowError(value any, targetType string) error
- func NewUnsupportedError(from, to string) error
- func To[T any](v any) (T, error)
- func ToBigInt(v any) (*big.Int, error)
- func ToBool(v any) (bool, error)
- func ToComplex64(v any) (complex64, error)
- func ToComplex128(v any) (complex128, error)
- func ToComplexFromString(s string) (complex128, error)
- func ToFloat[T ~float32 | ~float64](v any) (T, error)
- func ToFloat64(v any) (float64, error)
- func ToInt64(v any) (int64, error)
- func ToInteger[...](v any) (T, error)
- func ToLiteral(value any) (any, error)
- func ToString(v any) (string, error)
- func ToTime(value any) (time.Time, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Type compatibility errors ErrUnsupported = errors.New("conversion not supported") ErrNilPointer = errors.New("nil pointer") // Format and parsing errors ErrInvalidFormat = errors.New("invalid format") ErrEmptyInput = errors.New("empty input") // Numeric conversion errors ErrOverflow = errors.New("value overflow") ErrNegativeUint = errors.New("negative to unsigned") ErrNotWhole = errors.New("not whole number") )
Functions ¶
func NewEmptyInputError ¶
NewEmptyInputError creates a detailed empty input error for specific type
func NewFormatError ¶
NewFormatError creates a detailed format error with the problematic value
func NewNegativeUintError ¶
NewNegativeUintError creates a detailed negative to unsigned conversion error
func NewNotWholeError ¶
NewNotWholeError creates a detailed non-whole number error
func NewOverflowError ¶
NewOverflowError creates a detailed overflow error with the problematic value
func NewUnsupportedError ¶
NewUnsupportedError creates a detailed unsupported conversion error
func ToComplex64 ¶
func ToComplex128 ¶
func ToComplex128(v any) (complex128, error)
func ToComplexFromString ¶
func ToComplexFromString(s string) (complex128, error)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.