1
0
Fork 0
mirror of https://github.com/sourcegraph/jsonrpc2.git synced 2026-06-18 13:10:02 +02:00

add go module, simplify some cleanups

This commit is contained in:
Quinn Slack 2019-11-02 21:39:58 -07:00
parent 456318691a
commit 375ca94e9c
4 changed files with 11 additions and 13 deletions

View file

@ -221,8 +221,6 @@ const (
CodeMethodNotFound = -32601
CodeInvalidParams = -32602
CodeInternalError = -32603
// codeServerErrorStart = -32099
// codeServerErrorEnd = -32000
)
// Handler handles JSON-RPC requests and notifications.
@ -642,9 +640,8 @@ func (m *anyMessage) UnmarshalJSON(data []byte) error {
if len(msgs) == 0 {
return errors.New("jsonrpc2: invalid empty batch")
}
for i := range msgs {
var m = msgs[i]
if err := checkType(&m); err != nil {
for _, msg := range msgs {
if err := checkType(&msg); err != nil {
return err
}
}
@ -695,10 +692,3 @@ func (v *anyValueWithExplicitNull) UnmarshalJSON(data []byte) error {
return json.Unmarshal(data, &v.value)
}
/*
var (
errInvalidRequestJSON = errors.New("jsonrpc2: request must be either a JSON object or JSON array")
errInvalidResponseJSON = errors.New("jsonrpc2: response must be either a JSON object or JSON array")
)
*/