HandlerIndex sets the current index of the current context's handlers chain. If n < 0 or the current handlers length is 0 then it just returns the current handler index without change the current index. Look Handlers(), Next() and StopExecution() too.
(n int)
| 559 | // |
| 560 | // Look Handlers(), Next() and StopExecution() too. |
| 561 | func (ctx *Context) HandlerIndex(n int) (currentIndex int) { |
| 562 | if n < 0 || n > len(ctx.handlers)-1 { |
| 563 | return ctx.currentHandlerIndex |
| 564 | } |
| 565 | |
| 566 | ctx.currentHandlerIndex = n |
| 567 | return n |
| 568 | } |
| 569 | |
| 570 | // Proceed is an alternative way to check if a particular handler |
| 571 | // has been executed. |
no outgoing calls