一、 Next()
和 Abort()
的含义
-
Next()
的含义语法:
func (c *Context) Next()
英文原文
Next should be used only inside middleware. It executes the pending handlers in the chain inside the calling handler.
大意:Next 应该仅可以在中间件中使用,它在调用的函数中的链中执行挂起的函数。
-
Abort()
的含义语法:
func (c *Context)Abort()
英文原文
Abort prevents pending handlers from being called. Note that this will not stop the current handler. Let's say you have an authorization middleware that validates that the current request is authorized. If the authorization fails (ex: the password does not match), call Abort to ensure the remaining handlers for this req