reflectlite

package
v1.4.17 Latest Latest
Warning

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

Go to latest
Published: May 12, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IndirectKind

func IndirectKind(v reflect.Value) reflect.Kind

func IndirectType

func IndirectType(v reflect.Value) reflect.Type

func NilAble

func NilAble(v reflect.Value) bool

NilAble returns true if the type can be nil.

func Unwrap

func Unwrap(value reflect.Value) reflect.Value

Unwrap returns the value of the element if the type is a pointer or interface type.

Types

type Value

type Value struct {
	reflect.Value
}

func From

func From(v reflect.Value) Value

From returns a new Value initialized to the concrete value

func ValueOf

func ValueOf(v any) Value

ValueOf returns a new Value initialized to the concrete value stored in the interface i. ValueOf(nil) returns the zero Value.

func (Value) FindFieldFromTag

func (v Value) FindFieldFromTag(tagName, tagValue string) Value

FindFieldFromTag returns the field value by tag name and tag value. It returns the zero Value if not found or the type is not struct.

func (Value) IndirectKind

func (v Value) IndirectKind() reflect.Kind

IndirectKind returns the kind of the element if the type is a pointer type. Otherwise, it returns the kind of the type directly.

func (Value) IndirectType

func (v Value) IndirectType() reflect.Type

IndirectType returns the type of the element if the type is a pointer type. Otherwise, it returns the type directly.

func (Value) NilAble

func (v Value) NilAble() bool

NilAble returns true if the type can be nil.

func (Value) Unwrap

func (v Value) Unwrap() Value

Unwrap returns the value of the element if the type is a pointer or interface type.

Jump to

Keyboard shortcuts

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