mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-17 22:32:26 +08:00
Add a method Finish(),which can stop the current handler immediately.
This commit is contained in:
parent
4cabdd303f
commit
a7fb062aeb
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user