-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Labels
Description
I modified the example project a bit, adding this:
func nextUserId() string {
var next = nextid;
nextid += 1;
return strconv.Itoa(next)
}
func createUser(c *echo.Context) {
u := new(user)
u.ID = nextUserId()
u.Name = c.Param("name")
if c.Bind(u) {
users[u.ID] = *u
c.JSON(http.StatusCreated, u)
}
}Except u.Name is for some reason always the empty string. What am I doing wrong? I've looked at the context.go source and it looks like it should work.