Documentation
¶
Overview ¶
Package reflection implements the functions, types, and interfaces for the module.
Index ¶
- func FieldPointByType[T any](obj T) (*T, error)
- func FieldValueByType[T any](obj T) (T, error)
- func NewFieldNotFoundError(target, strct reflect.Type) error
- func NewInvalidStructError(v interface{}) error
- func NewTypeMismatchError(actual, expected reflect.Type) error
- type FieldNotFoundError
- type InvalidStructError
- type TypeMismatchError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FieldPointByType ¶
FieldPointByType returns the first field pointer in the struct that matches the target type
func FieldValueByType ¶
func NewFieldNotFoundError ¶
func NewInvalidStructError ¶
func NewInvalidStructError(v interface{}) error
func NewTypeMismatchError ¶
Types ¶
type FieldNotFoundError ¶
func (*FieldNotFoundError) Error ¶
func (e *FieldNotFoundError) Error() string
type InvalidStructError ¶
func (*InvalidStructError) Error ¶
func (e *InvalidStructError) Error() string
type TypeMismatchError ¶
func (*TypeMismatchError) Error ¶
func (e *TypeMismatchError) Error() string
Click to show internal directories.
Click to hide internal directories.