Chore: Enable more go-ruleguard rules (#29781)

* Chore: Enable more go-ruleguard rules

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
Arve Knudsen
2020-12-14 15:51:59 +01:00
committed by GitHub
parent e33c7cfbd2
commit 3fdf4be529
8 changed files with 56 additions and 62 deletions

View File

@@ -112,16 +112,14 @@ func (b *InProcBus) DispatchCtx(ctx context.Context, msg Msg) error {
func (b *InProcBus) Dispatch(msg Msg) error {
var msgName = reflect.TypeOf(msg).Elem().Name()
var handler = b.handlersWithCtx[msgName]
withCtx := true
handler := b.handlersWithCtx[msgName]
if handler == nil {
withCtx = false
handler = b.handlers[msgName]
}
if handler == nil {
return ErrHandlerNotFound
if handler == nil {
return ErrHandlerNotFound
}
}
var params = []reflect.Value{}