Documentation ¶
Index ¶
- Variables
- func CoerceSlice(slice reflect.Value, elemTyp reflect.Type) (reflect.Value, bool)
- func CoerceToPtr(givenType reflect.Type, desiredType reflect.Type) reflect.Type
- func CopyIndirect(src, target any)
- func CopySliceIndirect(src []any, target any)
- func DefaultValue[T comparable](value, defaultValue T) T
- func Exported(t any) bool
- func IsAny(typ reflect.Type) bool
- func IsNil(val any) bool
- func IsStruct(val any) bool
- func New[T any]() *T
- func NewWithTag(typ reflect.Type, tag reflect.StructTag) (any, error)
- func TargetSliceValue(target any) reflect.Value
- func TargetValue(target any) reflect.Value
- func TypeOf[T any]() reflect.Type
- func UnwrapErrors(errs ...error) []error
- func ValueAs[T any](v reflect.Value) (r T)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func CoerceSlice ¶
CoerceSlice attempts to upcast the elements of a slice and return the newly promoted slice and true if successful. If elemType is nil, the most specific type will be inferred.
func CoerceToPtr ¶
func CopyIndirect ¶
func CopyIndirect(src, target any)
CopyIndirect copies the contents of src into the target pointer or reflect.Value.
func CopySliceIndirect ¶
CopySliceIndirect copies the contents of src slice into the target pointer or reflect.Value.
func DefaultValue ¶ added in v0.30.87
func DefaultValue[T comparable]( value, defaultValue T, ) T
DefaultValue returns a default value if the supplied value is the types Zero value.
func TargetSliceValue ¶
TargetSliceValue validates the interface contains a non-nil typed slice pointer and return reflect.Value.
func TargetValue ¶
TargetValue validates the interface contains a non-nil typed pointer and return reflect.Value.
func UnwrapErrors ¶ added in v0.30.102
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.