Documentation
¶
Index ¶
- Variables
- func Convert[T any](value any) T
- func ImplementZero[T, I any]() I
- func IsExported[T any]() bool
- func IsFloat(v any) bool
- func IsFloat32(v any) bool
- func IsFloat64(v any) bool
- func IsImplement[I any](v any) bool
- func IsInt(v any) bool
- func IsNumber(v any) bool
- func IsPrimitiveFloat(v any) bool
- func IsPrimitiveFloat32(v any) bool
- func IsPrimitiveFloat64(v any) bool
- func IsPrimitiveInt(v any) bool
- func IsPrimitiveNumber(v any) bool
- func IsPrimitiveSignedInt(v any) bool
- func IsPrimitiveString(v any) bool
- func IsPrimitiveUnsignedInt(v any) bool
- func IsSignedInt(v any) bool
- func IsString(v any) bool
- func IsUnsignedInt(v any) bool
- func IsZeroImplement[T, I any]() bool
- func Zero[T any]() T
- type Number
Constants ¶
This section is empty.
Variables ¶
var ( IntKinds = map[reflect.Kind]bool{ reflect.Int: true, reflect.Int8: true, reflect.Int16: true, reflect.Int32: true, reflect.Int64: true, } UintKinds = map[reflect.Kind]bool{ reflect.Uint: true, reflect.Uint8: true, reflect.Uint16: true, reflect.Uint32: true, reflect.Uint64: true, } )
Functions ¶
func ImplementZero ¶
func ImplementZero[T, I any]() I
ImplementZero converts the zero value of type T to interface I.
func IsExported ¶
func IsImplement ¶
IsImplement returns true if value v implements interface I.
func IsPrimitiveFloat ¶
IsPrimitiveFloat returns true if the value is a float.
func IsPrimitiveFloat32 ¶
IsPrimitiveFloat32 returns true if the value is a float32.
func IsPrimitiveFloat64 ¶
IsPrimitiveFloat64 returns true if the value is a float64.
func IsPrimitiveInt ¶
IsPrimitiveInt returns true if the value is one of any integer types.
func IsPrimitiveNumber ¶
IsPrimitiveNumber returns true if the value is a number.
func IsPrimitiveSignedInt ¶
IsPrimitiveSignedInt returns true if the value is one of signed integer types.
func IsPrimitiveString ¶
IsPrimitiveString returns true if the value is a string.
func IsPrimitiveUnsignedInt ¶
IsPrimitiveUnsignedInt returns true if the value is one of unsigned integer types.
func IsSignedInt ¶
IsSignedInt returns true if the value is one of signed integer types.
func IsUnsignedInt ¶
IsUnsignedInt returns true if the value is one of unsigned integer types.
func IsZeroImplement ¶
IsZeroImplement returns true if the zero value of type T implements interface I.