func userCreateHandler(userDao UserDao, log log.Logger) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		username := r.FormValue("username")
		password := r.FormValue("password_confirm")
		u, err := user.New(username, password)
		if err != nil {
			writeInternalError(err, log, w)
			return
		}
		ctx := r.Context()
		if err := userDao.Create(ctx, *u); err != nil {
			writeInternalError(err, log, w)
			return
		}
	}
}
// userCreateHandler creates a user, adding it to the database.
userCreateHandler creates a user, adding it to the database.
// userCreateHandler creates a user adding it to the database .
func userCreateHandler(userDao UserDao, log log.Logger) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		username := r.FormValue("username")
		password := r.FormValue("password_confirm")
		u, err := user.New(username, password)
		if err != nil {
			writeInternalError(err, log, w)
			return
		}
		ctx := r.Context()
		if err := userDao.Create(ctx, *u); err != nil {
			writeInternalError(err, log, w)
			return
		}
	}
}
func userCreateHandler ( userDao UserDao , log log . Logger ) http . HandlerFunc { return func ( w http . ResponseWriter , r * http . Request ) { username := r . FormValue ( " " ) password := r . FormValue ( " " ) u , err := user . New ( username , password ) if err != nil { writeInternalError ( err , log , w ) return } ctx := r . Context ( ) if err := userDao . Create ( ctx , * u ) ; err != nil { writeInternalError ( err , log , w ) return } } }
userCreateHandler creates a user, adding it to the database.
userCreateHandler creates a user adding it to the database .