fix Context.Next() - recheck len of handlers every iteration

This commit is contained in:
Dmitry Kutakov 2019-01-17 11:08:44 +03:00
parent 29a145c85d
commit 5c26a13482

View File

@ -105,7 +105,7 @@ func (c *Context) Handler() HandlerFunc {
// See example in GitHub. // See example in GitHub.
func (c *Context) Next() { func (c *Context) Next() {
c.index++ c.index++
for s := int8(len(c.handlers)); c.index < s; c.index++ { for ; c.index < int8(len(c.handlers)); c.index++ {
c.handlers[c.index](c) c.handlers[c.index](c)
} }
} }