gobuch/best-practices/project-structure/dependency-sample/http/rest/handler.go

17 lines
311 B
Go
Raw Normal View History

2020-08-21 04:26:40 +00:00
package rest
import (
"fmt"
"net/http"
"time"
"golang.source-fellows.com/samples/applicationx"
)
func Handler(us applicationx.UserService) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
us.CreateUser(&applicationx.User{})
fmt.Fprintf(w, "Hello World! %s", time.Now())
}
}