Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MapToStruct ¶
将map转化为struct,支持弱类型,比如map中为"12313"的值,可以被转化到struct中类型为int的>字段中 支持的tag为mapstructure:"map的key",map中为此key的字段将被转化到tag所在的字段中 底层使用github.com/mitchellh/mapstructure
func StructToMap ¶
func StructToMap(s interface{}) map[string]interface{}
将struct转化为map,支持嵌套的struct 未导出的字段不会转化到map中 支持的tag为structs:"map的key" structs:"-"表明这个字段被忽略,不会转化到map中 底层使用github.com/fatih/structs,今后可能会统一为github.com/mitchellh/mapstructure
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.