reflec

package
v0.0.0-...-4873089 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2021 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanAssign

func CanAssign(t reflect.Type, kinds ...reflect.Kind) bool

CanAssign accept strings, or empty interfaces.

func Map2Struct

func Map2Struct(m map[string]interface{}, result interface{}) error

Map2Struct map m to struct by its type

Types

type StructField

type StructField struct {
	Index     int
	Name      string
	Tag       []string
	Kind      reflect.Kind
	Type      reflect.Type
	Anonymous bool
}

StructField 表示一个struct的字段属性

func CachedStructFields

func CachedStructFields(t reflect.Type, tagKey string) []StructField

CachedStructFields caches fields of struct type

Jump to

Keyboard shortcuts

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