MCPcopy
hub / github.com/gofiber/fiber / Next

Method Next

ctx.go:254–272  ·  view source on GitHub ↗

Next executes the next method in the stack that matches the current route.

()

Source from the content-addressed store, hash-verified

252
253// Next executes the next method in the stack that matches the current route.
254func (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.

Callers

nothing calls this directly

Calls 2

nextCustomMethod · 0.80
nextMethod · 0.45

Tested by

no test coverage detected