reflect

package
v1.2.1-beta2 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Field added in v1.2.1

func Field(data any, field string) (any, error)

Field reflect value via field name

func IsStruct

func IsStruct(typ Kind) bool

func IsZero

func IsZero(v any) bool

func Name

func Name(v any) string

Name return struct string name

func New

func New(v any) any

New returns a Value representing a pointer to a new zero value

func NewArray

func NewArray(v any) any

NewArray returns a []Value representing a pointer to a new zero value

func Path

func Path(typ reflect.Type, path ...string) string

func Set added in v1.2.1

func Set(data any, field string, value any)

Set data field value type and field must same

func ToSlice

func ToSlice(arr any) []any

ToSlice arr must array data array struct data to []interface

func TrueType

func TrueType(typ reflect.Type) reflect.Type

func TrueTypeof

func TrueTypeof(v any) reflect.Type

func TrueTypeofValue

func TrueTypeofValue(v any) (typ reflect.Type, i any)

func TrueValue

func TrueValue(typ reflect.Value) reflect.Value

func TrueValueOf

func TrueValueOf(v any) reflect.Value

Types

type Kind

type Kind interface {
	Kind() reflect.Kind
}

Jump to

Keyboard shortcuts

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