Add a method Finish(),which can stop the current handler immediately.

This commit is contained in:
xxx 2020-07-25 08:28:59 +08:00
parent 4cabdd303f
commit a7fb062aeb

View File

@ -156,6 +156,11 @@ func (c *Context) FullPath() string {
/*********** FLOW CONTROL ***********/
/************************************/
// Finish will stop the current handler immediately.
func (c *Context) Finish() {
c.Request.Body.Close()
}
// Next should be used only inside middleware.
// It executes the pending handlers in the chain inside the calling handler.
// See example in GitHub.