package
Version:
v0.1.2
Opens a new window with list of versions in this module.
Published: Jun 9, 2022
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{}, data interface{}) (err error)
MapToStruct
*
- @Description: Map转Struct
- @param m
- @param data
- @return err
func MapToStruct0(m map[string]interface{}, data interface{}) (err error)
MapToStruct0
*
- @Description: Map转Struct
- @param m
- @param data
- @return err
func StructToMap(obj interface{}) map[string]interface{}
StructToMap
*
- @Description: Struct转Map
- @param obj
- @return map[string]interface{}
type User struct {
Name string `json:"name"`
PhoneNumber string `json:"phone_number"`
UserName string `json:"userName"`
Hobbies []string `json:"hobbies"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.