1// +build !go1.7 2 3package httprouter 4 5import "net/http" 6 7// Handler is an adapter which allows the usage of an http.Handler as a 8// request handle. With go 1.7+, the Params will be available in the 9// request context under ParamsKey. 10func (r *Router) Handler(method, path string, handler http.Handler) { 11 r.Handle(method, path, 12 func(w http.ResponseWriter, req *http.Request, _ Params) { 13 handler.ServeHTTP(w, req) 14 }, 15 ) 16} 17