mirror of
https://github.com/sourcegraph/jsonrpc2.git
synced 2026-06-18 21:20:02 +02:00
Add a way to specify more non-standard-compliant fields to Request (#50)
This change introduces `ExtraField`, a `CallOption` that can add arbitrary fields to the top-level JSON-RPC Request message.
This commit is contained in:
parent
5cdc7d6ccd
commit
d6ac66e24f
5 changed files with 159 additions and 32 deletions
|
|
@ -24,7 +24,7 @@ func TestRequest_MarshalJSON_jsonrpc(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if want := `{"method":"","id":0,"jsonrpc":"2.0"}`; string(b) != want {
|
||||
if want := `{"id":0,"jsonrpc":"2.0","method":""}`; string(b) != want {
|
||||
t.Errorf("got %q, want %q", b, want)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue