Finish gorillize()

Co-authored-by: Roberto Abdelkader Martínez Pérez <robertomartinezp@gmail.com>
This commit is contained in:
pancho horrillo
2019-10-09 13:06:08 +02:00
parent 7d1f0bf97c
commit 401644b65e
2 changed files with 66 additions and 4 deletions
+2 -2
View File
@@ -7,11 +7,11 @@ import (
"github.com/gorilla/mux"
)
func gorillize(rs []model.Route, buildHandler func(*model.Route) http.Handler) *mux.Router {
func gorillize(rs []model.Route, buildHandler func(model.Route) http.Handler) *mux.Router {
m := mux.NewRouter()
for _, r := range rs {
m.Handle(r.Pattern, buildHandler(nil)).Methods(r.Method)
m.Handle(r.Pattern, buildHandler(r)).Methods(r.Method)
}
return m