mirror of
https://github.com/sourcegraph/jsonrpc2.git
synced 2026-06-16 04:04:56 +02:00
fix Using a reference for the variable on range scope (#32)
Signed-off-by: s3rj1k <evasive.gyron@gmail.com>
This commit is contained in:
parent
9d396041a5
commit
3bf62ad25c
1 changed files with 7 additions and 2 deletions
|
|
@ -644,8 +644,13 @@ func (m *anyMessage) UnmarshalJSON(data []byte) error {
|
|||
if len(msgs) == 0 {
|
||||
return errors.New("jsonrpc2: invalid empty batch")
|
||||
}
|
||||
for _, msg := range msgs {
|
||||
if err := checkType(&msg); err != nil {
|
||||
for i := range msgs {
|
||||
if err := checkType(&msg{
|
||||
ID: msgs[i].ID,
|
||||
Method: msgs[i].Method,
|
||||
Result: msgs[i].Result,
|
||||
Error: msgs[i].Error,
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue