diff --git a/client.go b/client.go index 8a9a145e9a8561f28e5a8bd86994e5cc9965fc13..03ec9bf1e339ec0cf0b871b176a8aabcc7777dbd 100644 --- a/client.go +++ b/client.go @@ -279,6 +279,8 @@ func (c *Client) call(ctx context.Context, result any, msg *jsonrpcMessage) erro return resp.Error case len(resp.Result) == 0: return ErrNoResult + case result == nil: + return nil default: return jzon.Unmarshal(resp.Result, &result) } diff --git a/mux.go b/mux.go index 6b908cb5175c1e6341b0abc9db08899e66dbc249..d8a4e3ef79c6b3bc4a3a62ab6b461bf8c0d02ac6 100644 --- a/mux.go +++ b/mux.go @@ -10,12 +10,12 @@ import ( var _ Router = &Mux{} -// Mux is a simple HTTP route multiplexer that parses a request path, +// Mux is a simple JRPC route multiplexer that parses a request path, // records any URL params, and executes an end handler. It implements // the Handler interface and is friendly with the standard library. // // Mux is designed to be fast, minimal and offer a powerful API for building -// modular and composable HTTP services with a large set of handlers. It's +// modular and composable JRPC services with a large set of handlers. It's // particularly useful for writing large REST API services that break a handler // into many smaller parts composed of middlewares and end handlers. type Mux struct { @@ -356,7 +356,7 @@ func (mx *Mux) handle(pattern string, handler Handler) *node { return mx.tree.InsertRoute(pattern, h) } -// routeHTTP routes a Request through the Mux routing tree to serve +// routeJRPC routes a Request through the Mux routing tree to serve // the matching handler for a particular http method. func (mx *Mux) routeRPC(w ResponseWriter, r *Request) { // Grab the route context object