我有以下路线:
m.Post("/users", binding.Bind(models.User{}), func(user models.User, r render.Render)
当我尝试发出Post
请求时,我收到以下错误消息:
“恐慌:reflect.Value.Interface:无法返回从未导出的字段或方法获得的值”
type User struct {
id int
UUID string `json:"uuid"`
Username string `json:"userName" form:"userName" binding:"required"`
Firstname string `json:"firstName" form:"Firstname" binding:"required`
Lastname string `json:"lastName" form:"Lastname" binding:"required`
Email string `json:"email" form:"Email" binding:"required`
IsActive bool `json:"isActive"`
DateJoined time.Time `json:"dateJoined"`
}
有人有什么主意吗?