We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
func (c *Context) Next() { c.index++ s := len(c.handlers) for ; c.index < s; c.index++ { c.handlers[c.index](c) } }
这里的for循环是不是应该改为直接调用下一个Handler
func (c *Context) Next() { c.index++ s := len(c.handlers) if c.index < s { c.handlers[c.index](c) } }
The text was updated successfully, but these errors were encountered:
博客里提到了,不是所有的中间件都会调用这个next函数。若不采用for循环的做法,使用的中间件没有调用next的话,那么无法执行下一个HandlerFunc。
Sorry, something went wrong.
No branches or pull requests
func (c *Context) Next() {
c.index++
s := len(c.handlers)
for ; c.index < s; c.index++ {
c.handlers[c.index](c)
}
}
这里的for循环是不是应该改为直接调用下一个Handler
func (c *Context) Next() {
c.index++
s := len(c.handlers)
if c.index < s {
c.handlers[c.index](c)
}
}
The text was updated successfully, but these errors were encountered: