reflect

package
v0.0.53 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2025 License: Apache-2.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllFieldName added in v0.0.49

func AllFieldName(value interface{}) ([]string, error)

AllFieldName 返回结构体的所有字段

func AllFieldValue added in v0.0.46

func AllFieldValue(value interface{}) (map[string]interface{}, error)

AllFieldValue 返回结构体的所有字段的值

func DeepCopy

func DeepCopy(src interface{}) interface{}

DeepCopy 深拷贝 源和目标需要是同类型

func NonZeroFieldName added in v0.0.49

func NonZeroFieldName(value interface{}) ([]string, error)

NonZeroFieldName 返回结构体的非零字段

func NonZeroFieldValue

func NonZeroFieldValue(value interface{}) (map[string]interface{}, error)

NonZeroFieldValue 返回结构体的非零字段的值

func SetFieldValue added in v0.0.49

func SetFieldValue(structPtr any, values map[string]any, checkMissingField ...bool) error

SetFieldValue 将 map[string]any 中的值赋给 structPtr 指向的结构体中对应字段

Types

This section is empty.

Jump to

Keyboard shortcuts

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