Documentation ¶
Index ¶
- func Add(source, target map[string]interface{}) map[string]interface{}
- func FromJsonStr(str string) interface{}
- func MapToStruct(m map[string]interface{}, t interface{})
- func ObjByAnchorFromMap(obj interface{}, anchor []string) interface{}
- func StructToMap(obj interface{}) map[string]interface{}
- func ToJsonStr(obj interface{}) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromJsonStr ¶
func FromJsonStr(str string) interface{}
func MapToStruct ¶
func MapToStruct(m map[string]interface{}, t interface{})
* go get github.com/goinggo/mapstructure
func MapToStructDemo(){ mapInstance := make(map[string]interface{}) mapInstance["Name"] = "jqw" mapInstance["Age"] = 18 var people People err := mapstructure.Decode(mapInstance, &people) if err != nil { fmt.Println(err) } fmt.Println(people) }
func ObjByAnchorFromMap ¶
func ObjByAnchorFromMap(obj interface{}, anchor []string) interface{}
func StructToMap ¶
func StructToMap(obj interface{}) map[string]interface{}
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.