feat(Go-StudyExample):创建项目,添加使用示例如下:

map与struct之间转换的处理工具使用示例,参考代码地址:https://github.com/mitchellh/mapstructure
json与struct之间转换处理工具使用示例
This commit is contained in:
huangzj
2020-04-28 17:51:57 +08:00
commit 4feb1f61f2
7 changed files with 263 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
package entity
type Entity struct {
Num int
S string
T map[string]string
}
+20
View File
@@ -0,0 +1,20 @@
/*
* @Author : huangzj
* @Time : 2020/3/26 18:18
* @Description
*/
package entity
import "time"
type UserType struct {
UserTypeId int
UserTypeName string
}
type User struct {
UserType UserType `jpath:"userType"`
LoginName string `jpath:"loginName"`
T time.Time `jpath:"t"`
}