Skip to content

Commit

Permalink
fix: closure error
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangxu19830126 committed Dec 25, 2017
1 parent f0aeb92 commit 999ad77
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions http.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,24 @@ func (s *httpServer) stop() error {

func (s *httpServer) addHTTPEntrypoints(httpEntrypoints ...*httpEntrypoint) {
for _, ep := range httpEntrypoints {
invoker := ep
m := strings.ToUpper(ep.method)
switch m {
case echo.GET:
s.server.GET(ep.path, func(c echo.Context) error {
return s.handleHTTP(c, ep)
return s.handleHTTP(c, invoker)
})
case echo.PUT:
s.server.PUT(ep.path, func(c echo.Context) error {
return s.handleHTTP(c, ep)
return s.handleHTTP(c, invoker)
})
case echo.DELETE:
s.server.DELETE(ep.path, func(c echo.Context) error {
return s.handleHTTP(c, ep)
return s.handleHTTP(c, invoker)
})
case echo.POST:
s.server.POST(ep.path, func(c echo.Context) error {
return s.handleHTTP(c, ep)
return s.handleHTTP(c, invoker)
})
}
}
Expand Down

0 comments on commit 999ad77

Please sign in to comment.