Increase legibility of gorillize function
This commit is contained in:
@@ -7,11 +7,11 @@ import (
|
|||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
)
|
)
|
||||||
|
|
||||||
func gorillize(rs []model.Route, f func(*model.Route) http.Handler) *mux.Router {
|
func gorillize(rs []model.Route, buildHandler func(*model.Route) http.Handler) *mux.Router {
|
||||||
m := mux.NewRouter()
|
m := mux.NewRouter()
|
||||||
|
|
||||||
for _, r := range rs {
|
for _, r := range rs {
|
||||||
m.Handle(r.Pattern, f(nil)).Methods(r.Method)
|
m.Handle(r.Pattern, buildHandler(nil)).Methods(r.Method)
|
||||||
}
|
}
|
||||||
|
|
||||||
return m
|
return m
|
||||||
|
|||||||
Reference in New Issue
Block a user