Martini Binding“无法返回从未导出的字段或方法获得的值”

I have the following route:

m.Post("/users", binding.Bind(models.User{}), func(user models.User, r render.Render)

And I receive the following error message when I try to do a Post request:

"PANIC: reflect.Value.Interface: cannot return value obtained from unexported field or method"

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"`
}

Does anyone have any idea?

I know the problem now.

The problem is the attribute "id" of the User struct. If "id" is renamed to "Id" the binding process works perfectly.

With tag form:"-" you can ignore struct attributes.

type User struct {
    id         int       `form:"-"`
    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"`
}