()
| 38 | } |
| 39 | |
| 40 | func (r *router) Handler() http.Handler { |
| 41 | return appHandler(func(w http.ResponseWriter, req *http.Request) *appError { |
| 42 | for _, route := range r.routes { |
| 43 | if route.match(req) { |
| 44 | return route.handler(w, req) |
| 45 | } |
| 46 | } |
| 47 | return NotFoundHandler(w, req) |
| 48 | }) |
| 49 | } |
| 50 | |
| 51 | func (r *route) Header(header, value string) { |
| 52 | r.MatcherFunc(func(req *http.Request) bool { |
nothing calls this directly
no test coverage detected