Add method to return main handler (#930)

Fix #928 Method to get main handler is desired
This commit is contained in:
collinmsn
2017-06-02 16:00:55 +08:00
committed by Bo-Yi Wu
parent 5eea51b6c9
commit 3f95933c3d
2 changed files with 18 additions and 0 deletions

View File

@ -85,6 +85,11 @@ func (c *Context) HandlerName() string {
return nameOfFunction(c.handlers.Last())
}
// Handler returns the main handler.
func (c *Context) Handler() HandlerFunc {
return c.handlers.Last()
}
/************************************/
/*********** FLOW CONTROL ***********/
/************************************/