1
0
Fork 0
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:
Kevin Gillette 2025-02-15 23:37:44 -07:00
parent 534fd43609
commit ec6ca95995
No known key found for this signature in database
GPG key ID: 93B201FCCF7BFC8B
4 changed files with 72 additions and 89 deletions

View file

@ -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: