refactor: handler signature an middlewares for an idiomatic solution #24
|
@ -261,7 +261,7 @@ type res struct{
|
||||||
Output2 bool
|
Output2 bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func myHandler(r req) (*res, api.Err) {
|
func myHandler(ctx *api.Context, r req) (*res, api.Err) {
|
||||||
err := doSomething()
|
err := doSomething()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, api.ErrFailure
|
return nil, api.ErrFailure
|
||||||
|
|
Loading…
Reference in New Issue