func (us *UserRepository) FindByName(name string) *model.User {
	u := model.User{}
	us.GormDB.Debug().Where("name = ?", name).First(&u)
	return &u
}
FindByName returns a user for a given name.
package mysql
import (
	"github.com/gin-gonic/gin"
	"github.com/jinzhu/gorm"
	"github.com/qclaogui/goforum/model"
)
type UserRepository struct {
	GormDB *gorm.DB
}
func (us *UserRepository) FindByID(id string) *model.User {
	u := model.User{}
	us.GormDB.Debug().First(&u, id)
	return &u
}