reflectutil

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TypeError = reflect.TypeOf((*error)(nil)).Elem()
)

Functions

func Convert added in v0.8.0

func Convert(t reflect.Type, v reflect.Value) (ret reflect.Value, ok bool, retErr error)

Convert returns the value v converted to type t.

func ConvertInterface added in v0.8.0

func ConvertInterface(t reflect.Type, v interface{}) (interface{}, bool, error)

ConvertInterface returns the value v converted to type t.

func ConvertString added in v0.8.1

func ConvertString(v reflect.Value) (string, error)

ConvertString converts v to string.

func ConvertStrings added in v0.8.1

func ConvertStrings(v reflect.Value) ([]string, error)

ConvertStrings converts v to []string.

func ConvertStringsMap

func ConvertStringsMap(v reflect.Value) (map[string][]string, error)

ConvertStringsMap converts map[string]string to map[string][]string.

func Elem

func Elem(v reflect.Value) reflect.Value

Elem calls v.Elem() recursively. It returns v as it is if v's Kind is not reflect.Interface or reflect.Ptr.

func Set added in v0.8.0

func Set(target, v reflect.Value) (retErr error)

Set assigns v to the value target.

Types

This section is empty.

Jump to

Keyboard shortcuts

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