From ec880b1737ffd42e42f6e97b19172bd73e3adba1 Mon Sep 17 00:00:00 2001 From: MariusVanDerWijden Date: Tue, 10 Jun 2025 22:41:13 +0200 Subject: [PATCH] rpc: use go-json --- rpc/json.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rpc/json.go b/rpc/json.go index fcd801fc95..5f49fdb7f3 100644 --- a/rpc/json.go +++ b/rpc/json.go @@ -27,6 +27,8 @@ import ( "strings" "sync" "time" + + gojson "github.com/goccy/go-json" ) const ( @@ -308,7 +310,7 @@ func isBatch(raw json.RawMessage) bool { // given types. It returns the parsed values or an error when the args could not be // parsed. Missing optional arguments are returned as reflect.Zero values. func parsePositionalArguments(rawArgs json.RawMessage, types []reflect.Type) ([]reflect.Value, error) { - dec := json.NewDecoder(bytes.NewReader(rawArgs)) + dec := gojson.NewDecoder(bytes.NewReader(rawArgs)) var args []reflect.Value tok, err := dec.Token() switch { @@ -335,7 +337,7 @@ func parsePositionalArguments(rawArgs json.RawMessage, types []reflect.Type) ([] return args, nil } -func parseArgumentArray(dec *json.Decoder, types []reflect.Type) ([]reflect.Value, error) { +func parseArgumentArray(dec *gojson.Decoder, types []reflect.Type) ([]reflect.Value, error) { args := make([]reflect.Value, 0, len(types)) for i := 0; dec.More(); i++ { if i >= len(types) {