1
0
Fork 0
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:
Quinn Slack 2017-01-22 16:05:00 -08:00
parent a61d8f7bd7
commit 64d0b93a7a
2 changed files with 16 additions and 4 deletions

View file

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