From ef620627699215d0319596daaa5db62a817c8b4c Mon Sep 17 00:00:00 2001 From: a <a@tuxpa.in> Date: Mon, 25 Mar 2024 12:55:29 -0500 Subject: [PATCH] a --- pkg/jsonrpc/encode.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/jsonrpc/encode.go b/pkg/jsonrpc/encode.go index e7327c3..7553fff 100644 --- a/pkg/jsonrpc/encode.go +++ b/pkg/jsonrpc/encode.go @@ -31,6 +31,14 @@ func EncodeObject(wr io.Writer, dat any) error { } } return nil + case json.Marshaler: + return jjson.Encode(wr, cast) + case io.Reader: + _, err := io.Copy(wr, cast) + if err != nil { + return err + } + return nil default: return jjson.Encode(wr, cast) } -- GitLab