Finish gorillize()
Co-authored-by: Roberto Abdelkader Martínez Pérez <robertomartinezp@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user