mirror of
https://github.com/sourcegraph/jsonrpc2.git
synced 2026-06-16 04:04:56 +02:00
propagate JSON "null" result instead of treating it as Go nil (and field-not-present in JSON)
This commit is contained in:
parent
a61d8f7bd7
commit
64d0b93a7a
2 changed files with 16 additions and 4 deletions
|
|
@ -36,6 +36,7 @@ func TestAnyMessage(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestMessageCodec(t *testing.T) {
|
||||
obj := json.RawMessage(`{"foo":"bar"}`)
|
||||
tests := []struct {
|
||||
v, vempty interface{}
|
||||
}{
|
||||
|
|
@ -44,8 +45,8 @@ func TestMessageCodec(t *testing.T) {
|
|||
vempty: &Request{ID: ID{Num: 123}},
|
||||
},
|
||||
{
|
||||
v: &Response{ID: ID{Num: 123}},
|
||||
vempty: &Response{ID: ID{Num: 123}},
|
||||
v: &Response{ID: ID{Num: 123}, Result: &obj},
|
||||
vempty: &Response{ID: ID{Num: 123}, Result: &obj},
|
||||
},
|
||||
}
|
||||
for _, test := range tests {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue