xreflect

package
v0.0.0-...-d2252c6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 30, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func Convert

func Convert[T any](value any) T

Convert returns the value converted to type T.

func ImplementZero

func ImplementZero[T, I any]() I

ImplementZero converts the zero value of type T to interface I.

func IsExported

func IsExported[T any]() bool

func IsFloat

func IsFloat(v any) bool

IsFloat returns true if the value is a float.

func IsFloat32

func IsFloat32(v any) bool

IsFloat32 returns true if the value is a float32.

func IsFloat64

func IsFloat64(v any) bool

IsFloat64 returns true if the value is a float64.

func IsImplement

func IsImplement[I any](v any) bool

IsImplement returns true if value v implements interface I.

func IsInt

func IsInt(v any) bool

IsInt returns true if the value is one of any integer types.

func IsNumber

func IsNumber(v any) bool

IsNumber returns true if the value is a number.

func IsPrimitiveFloat

func IsPrimitiveFloat(v any) bool

IsPrimitiveFloat returns true if the value is a float.

func IsPrimitiveFloat32

func IsPrimitiveFloat32(v any) bool

IsPrimitiveFloat32 returns true if the value is a float32.

func IsPrimitiveFloat64

func IsPrimitiveFloat64(v any) bool

IsPrimitiveFloat64 returns true if the value is a float64.

func IsPrimitiveInt

func IsPrimitiveInt(v any) bool

IsPrimitiveInt returns true if the value is one of any integer types.

func IsPrimitiveNumber

func IsPrimitiveNumber(v any) bool

IsPrimitiveNumber returns true if the value is a number.

func IsPrimitiveSignedInt

func IsPrimitiveSignedInt(v any) bool

IsPrimitiveSignedInt returns true if the value is one of signed integer types.

func IsPrimitiveString

func IsPrimitiveString(v any) bool

IsPrimitiveString returns true if the value is a string.

func IsPrimitiveUnsignedInt

func IsPrimitiveUnsignedInt(v any) bool

IsPrimitiveUnsignedInt returns true if the value is one of unsigned integer types.

func IsSignedInt

func IsSignedInt(v any) bool

IsSignedInt returns true if the value is one of signed integer types.

func IsString

func IsString(v any) bool

IsString returns true if the value is a string.

func IsUnsignedInt

func IsUnsignedInt(v any) bool

IsUnsignedInt returns true if the value is one of unsigned integer types.

func IsZeroImplement

func IsZeroImplement[T, I any]() bool

IsZeroImplement returns true if the zero value of type T implements interface I.

func Zero

func Zero[T any]() T

Zero gets the zero value of type T.

Types

type Number

type Number interface {
	int | int8 | int16 | int32 | int64 |
		uint | uint8 | uint16 | uint32 | uint64 |
		float32 | float64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL