package
Version:
v0.0.0-...-c9a36a8
Opens a new window with list of versions in this module.
Published: Jun 27, 2018
License: MIT
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
func MapToStruct(m map[string]interface{}, o interface{}) error
将map键值对映射到对应的struct对象属性上,需要注意:
1、第二个参数为struct对象指针;
2、struct对象的公开属性才能被映射赋值;
3、map中的键名可以为小写,映射转换时会自动将键名首字母转为大写做匹配映射,如果无法匹配则忽略;
Source Files
¶
Click to show internal directories.
Click to hide internal directories.