reflect

package
v0.27.7 Latest Latest
Warning

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

Go to latest
Published: May 25, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FieldValues

func FieldValues(s interface{}) map[string]interface{}

FieldValues returns a map of names and values of the top-level exported fields in a struct. Anonymous fields are ignored, as well as non-exported fields.

func InterfaceSlice added in v0.9.0

func InterfaceSlice(in any) (o []any)

InterfaceSlice converts a slice of any object to a slice of interfaces of those internal objects if in is not an addressable item, it will panic

func IsSlice added in v0.26.0

func IsSlice(in any) bool

func JoinStringers added in v0.26.2

func JoinStringers(in any, sep string) (out string)

JoinStringers will join a slice of any kind of objects that are Stringers. If the passed in object is not addressable, it will panic. Any objects that are not stringers will result in a missing item in the result.

func SetFieldValues

func SetFieldValues(s interface{}, values map[string]interface{}) error

SetFieldValues will restore values the were extracted using FieldValues

Types

This section is empty.

Jump to

Keyboard shortcuts

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