1
0
mirror of https://github.com/labstack/echo.git synced 2025-06-25 00:47:01 +02:00

Deferred defer

Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana
2015-04-08 22:23:47 -07:00
parent 2342df3e61
commit 055200818a
2 changed files with 2 additions and 2 deletions

View File

@ -216,11 +216,11 @@ func (r *router) Find(method, path string) (h HandlerFunc, c *Context, echo *Ech
func (r *router) ServeHTTP(w http.ResponseWriter, req *http.Request) {
h, c, _ := r.Find(req.Method, req.URL.Path)
defer r.echo.pool.Put(c)
c.Response.ResponseWriter = w
if h != nil {
h(c)
} else {
r.echo.notFoundHandler(c)
}
r.echo.pool.Put(c)
}