1
0
Fork 0
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:
lhchavez 2021-08-04 05:45:59 -07:00 committed by GitHub
parent 5cdc7d6ccd
commit d6ac66e24f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 159 additions and 32 deletions

View file

@ -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)
}
}