mirror

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIncompatibleTypes = errors.New("incompatible types")
)

Functions

func CanSet

func CanSet(dst, src reflect.Value) bool

CanSet returns true if the reflect.Value.Set can be called without panic.

func Instantiate

func Instantiate(field reflect.Value) error

Instantiate if the field is zero, the field is set. If the field can't be set, an error is returned.

func Set

func Set(dst, src reflect.Value) error

Set calls dst.Set(src) but won't panic and instead returns an error.

func StripPtrs

func StripPtrs(val reflect.Value) reflect.Value

StripPtrs returns the core value underneath an arbitrary number of pointers.

func StripTypePtrs

func StripTypePtrs(typ reflect.Type) reflect.Type

StripTypePtrs returns the core type underneath an arbitrary number of pointers.

Types

This section is empty.

Jump to

Keyboard shortcuts

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