Skip to content

Commit

Permalink
Added Type HandlerFunc to wrapH
Browse files Browse the repository at this point in the history
This was done so that middleware can easily be used in the normal add
context. This helps chaining middleware on single calls.
  • Loading branch information
tanema committed Apr 27, 2015
1 parent e3e16ee commit cbc848f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions echo.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,8 @@ func wrapM(m Middleware) MiddlewareFunc {
// wraps Handler
func wrapH(h Handler) HandlerFunc {
switch h := h.(type) {
case HandlerFunc:
return h
case func(*Context):
return func(c *Context) error {
h(c)
Expand Down

0 comments on commit cbc848f

Please sign in to comment.