File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,17 @@ type Router struct {
6464 useEncodedPath bool
6565}
6666
67- // Match matches registered routes against the request.
67+ // Match attempts to match the given request against the router's registered routes.
68+ //
69+ // If the request matches a route of this router or one of its subrouters the Route,
70+ // Handler, and Vars fields of the the match argument are filled and this function
71+ // returns true.
72+ //
73+ // If the request does not match any of this router's or its subrouters' routes
74+ // then this function returns false. If available, a reason for the match failure
75+ // will be filled in the match argument's MatchErr field. If the match failure type
76+ // (eg: not found) has a registered handler, the handler is assigned to the Handler
77+ // field of the match argument.
6878func (r * Router ) Match (req * http.Request , match * RouteMatch ) bool {
6979 for _ , route := range r .routes {
7080 if route .Match (req , match ) {
You can’t perform that action at this time.
0 commit comments