mirror of
https://github.com/sourcegraph/jsonrpc2.git
synced 2026-06-16 04:04:56 +02:00
No description
As documented: OnRecv causes all requests received on conn to invoke f(req, nil) and all responses to invoke f(req, resp). Since OnRecv is called with both *Request and *Response being non-nil when we're handling a response, we need to check that *Response is non-nil before we check *Request is non-nil. This change just swaps the two cases in the switch statement to fix the issue. For consistency, I've swapped the cases for OnSend also, even when it's not needed. |
||
|---|---|---|
| .github/workflows | ||
| websocket | ||
| .travis.yml | ||
| async.go | ||
| call_opt.go | ||
| call_opt_test.go | ||
| codec_test.go | ||
| conn.go | ||
| conn_opt.go | ||
| conn_opt_test.go | ||
| conn_test.go | ||
| example_params_test.go | ||
| example_test.go | ||
| go.mod | ||
| go.sum | ||
| handler_with_error.go | ||
| internal_test.go | ||
| jsonrpc2.go | ||
| jsonrpc2_test.go | ||
| LICENSE | ||
| README.md | ||
| request.go | ||
| request_test.go | ||
| response.go | ||
| response_test.go | ||
| stream.go | ||
jsonrpc2: JSON-RPC 2.0 implementation for Go

Package jsonrpc2 provides a Go implementation of JSON-RPC 2.0.
Known issues
- Batch requests and responses are not yet supported.