Next executes the next method in the stack that matches the current route.
()
| 252 | |
| 253 | // Next executes the next method in the stack that matches the current route. |
| 254 | func (c *DefaultCtx) Next() error { |
| 255 | // Increment handler index |
| 256 | c.indexHandler++ |
| 257 | |
| 258 | // Did we execute all route handlers? |
| 259 | if c.indexHandler < len(c.route.Handlers) { |
| 260 | if c.handlerCtx != nil { |
| 261 | return c.route.Handlers[c.indexHandler](c.handlerCtx) |
| 262 | } |
| 263 | return c.route.Handlers[c.indexHandler](c) |
| 264 | } |
| 265 | |
| 266 | if c.handlerCtx != nil { |
| 267 | _, err := c.app.nextCustom(c.handlerCtx) |
| 268 | return err |
| 269 | } |
| 270 | _, err := c.app.next(c) |
| 271 | return err |
| 272 | } |
| 273 | |
| 274 | // RestartRouting instead of going to the next handler. This may be useful after |
| 275 | // changing the request path. Note that handlers might be executed again. |
nothing calls this directly
no test coverage detected