Skip to content

Commit

Permalink
🚀 chore: znet.handler that supports parsing the return error
Browse files Browse the repository at this point in the history
  • Loading branch information
sohaha committed Jul 21, 2024
1 parent caa5f76 commit 92bccaf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions znet/inject.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ func (utils) ParseHandlerFunc(h Handler) (fn handlerFn) {
v(c)
return nil
}
case func(c *Context) error:
return v
case func(*Context) (interface{}, error):
return func(c *Context) error {
res, err := v(c)
Expand Down

0 comments on commit 92bccaf

Please sign in to comment.