mirror of
https://github.com/sourcegraph/jsonrpc2.git
synced 2026-06-28 05:23:40 +02:00
transparently simplify control flow
This commit is contained in:
parent
534fd43609
commit
ec6ca95995
4 changed files with 72 additions and 89 deletions
|
|
@ -44,11 +44,9 @@ func LogMessages(logger Logger) ConnOpt {
|
|||
OnRecv(func(req *Request, resp *Response) {
|
||||
switch {
|
||||
case resp != nil:
|
||||
var method string
|
||||
method := "(no matching request)"
|
||||
if req != nil {
|
||||
method = req.Method
|
||||
} else {
|
||||
method = "(no matching request)"
|
||||
}
|
||||
switch {
|
||||
case resp.Result != nil:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue