Пример #1
0
func (c *UserController) Users() {
	userId, _ := c.GetInt(":id")
	var user, err = models.User(userId)
	if err != nil {
		c.Data["json"] = nil
	} else {
		c.Data["json"] = user
	}
	c.ServeJson()
}
Пример #2
0
func TestGetUsers(t *testing.T) {

	fmt.Println("*************************")
	var users = models.User(1)
	fmt.Println("users", users[1])
	for _, user := range users {

		fmt.Println(user)
	}
}