reflect

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TypeOf    = reflect.TypeOf
	ValueOf   = reflect.ValueOf
	UnsafeNew = reflect.New
	PtrTo     = reflect.PtrTo
	ErrorType = reflect.TypeOf((*error)(nil)).Elem()
)

Functions

func IsFunc

func IsFunc(t Type) bool

func SPrint

func SPrint(value any) string

func SameType

func SameType(a, b any) bool

func Signature

func Signature(value any) string

func Typename

func Typename(value any) string

func Zero

func Zero(t reflect.Type) (value reflect.Value, err error)

Types

type FuncT

type FuncT struct {
	Value
	Ins  []Type
	Outs []Type
}

func Func

func Func(fn any) (*FuncT, error)

func (FuncT) Call

func (f FuncT) Call(args ...Value) (any, error)

func (FuncT) CallResult

func (f FuncT) CallResult(args ...Value) (any, error)

func (FuncT) ReturnsResult

func (f FuncT) ReturnsResult() bool

func (FuncT) String

func (f FuncT) String() string

type Reflection

type Reflection struct {
	Type
	Value
}

convenience reexports

type StructT

type StructT struct {
	reflect.Type
	Fields map[string]reflect.StructField
	Tags   map[string]*structtag.Tags
}

func Struct

func Struct(s any) (*StructT, error)

type Type

type Type = reflect.Type

convenience reexports

type Value

type Value = reflect.Value

convenience reexports

Jump to

Keyboard shortcuts

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