@@ -16,19 +16,19 @@ import (
1616)
1717
1818type RouterPathGroup struct {
19- r * Router
20- pathParam string
21- processors []* routerPathMatcher
19+ r * Router
20+ pathParam string
21+ matchers []* routerPathMatcher
2222}
2323
2424func (g * RouterPathGroup ) ServeHTTP (resp http.ResponseWriter , req * http.Request ) {
2525 chiCtx := chi .RouteContext (req .Context ())
2626 path := chiCtx .URLParam (g .pathParam )
27- for _ , p := range g .processors {
28- if p .matchPath (chiCtx , path ) {
29- handler := p .handlerFunc
30- for i := len (p .middlewares ) - 1 ; i >= 0 ; i -- {
31- handler = p .middlewares [i ](handler ).ServeHTTP
27+ for _ , m := range g .matchers {
28+ if m .matchPath (chiCtx , path ) {
29+ handler := m .handlerFunc
30+ for i := len (m .middlewares ) - 1 ; i >= 0 ; i -- {
31+ handler = m .middlewares [i ](handler ).ServeHTTP
3232 }
3333 handler (resp , req )
3434 return
@@ -42,7 +42,7 @@ func (g *RouterPathGroup) ServeHTTP(resp http.ResponseWriter, req *http.Request)
4242// It is only designed to resolve some special cases which chi router can't handle.
4343// For most cases, it shouldn't be used because it needs to iterate all rules to find the matched one (inefficient).
4444func (g * RouterPathGroup ) MatchPath (methods , pattern string , h ... any ) {
45- g .processors = append (g .processors , newRouterPathMatcher (methods , pattern , h ... ))
45+ g .matchers = append (g .matchers , newRouterPathMatcher (methods , pattern , h ... ))
4646}
4747
4848type routerPathParam struct {
0 commit comments