Skip to content

Commit

Permalink
Fix linter error
Browse files Browse the repository at this point in the history
  • Loading branch information
nkryuchkov committed Dec 12, 2019
1 parent da3569e commit b0115ce
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/router/route_group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -465,17 +465,18 @@ func pushPackets(ctx context.Context, t *testing.T, from *transport.Manager, to
panic("malformed packet")
}

if safeSend(to, ctx, payload) {
if safeSend(ctx, to, payload) {
return
}
}
}
}

func safeSend(to *RouteGroup, ctx context.Context, payload []byte) (interrupt bool) {
func safeSend(ctx context.Context, to *RouteGroup, payload []byte) (interrupt bool) {
defer func() {
if r := recover(); r != nil {
interrupt = r != "send on closed channel" // TODO: come up with idea how to handle this case
// TODO: come up with idea how to get rid of panic
interrupt = r != "send on closed channel"
}
}()

Expand Down

0 comments on commit b0115ce

Please sign in to comment.