@@ -86,7 +86,7 @@ func (c *Conn) Close() error {
8686// waits for the response. If the response is successful, its result is stored
8787// in result (a pointer to a value that can be JSON-unmarshaled into);
8888// otherwise, a non-nil error is returned. See DispatchCall for more details.
89- func (c * Conn ) Call (ctx context.Context , method string , params , result interface {} , opts ... CallOption ) error {
89+ func (c * Conn ) Call (ctx context.Context , method string , params , result any , opts ... CallOption ) error {
9090 call , err := c .DispatchCall (ctx , method , params , opts ... )
9191 if err != nil {
9292 return err
@@ -108,7 +108,7 @@ func (c *Conn) DisconnectNotify() <-chan struct{} {
108108// The params member is omitted from the JSON-RPC request if the given params is
109109// nil. Use json.RawMessage("null") to send a JSON-RPC request with its params
110110// member set to null.
111- func (c * Conn ) DispatchCall (ctx context.Context , method string , params interface {} , opts ... CallOption ) (Waiter , error ) {
111+ func (c * Conn ) DispatchCall (ctx context.Context , method string , params any , opts ... CallOption ) (Waiter , error ) {
112112 req := & Request {Method : method }
113113 for _ , opt := range opts {
114114 if opt == nil {
@@ -137,7 +137,7 @@ func (c *Conn) DispatchCall(ctx context.Context, method string, params interface
137137// The params member is omitted from the JSON-RPC request if the given params is
138138// nil. Use json.RawMessage("null") to send a JSON-RPC request with its params
139139// member set to null.
140- func (c * Conn ) Notify (ctx context.Context , method string , params interface {} , opts ... CallOption ) error {
140+ func (c * Conn ) Notify (ctx context.Context , method string , params any , opts ... CallOption ) error {
141141 req := & Request {Method : method , Notif : true }
142142 for _ , opt := range opts {
143143 if opt == nil {
@@ -157,7 +157,7 @@ func (c *Conn) Notify(ctx context.Context, method string, params interface{}, op
157157}
158158
159159// Reply sends a successful response with a result.
160- func (c * Conn ) Reply (ctx context.Context , id ID , result interface {} ) error {
160+ func (c * Conn ) Reply (ctx context.Context , id ID , result any ) error {
161161 resp := & Response {ID : id }
162162 if err := resp .SetResult (result ); err != nil {
163163 return err
@@ -346,7 +346,7 @@ type Waiter struct {
346346// is successful, its result is stored in result (a pointer to a
347347// value that can be JSON-unmarshaled into); otherwise, a non-nil
348348// error is returned.
349- func (w Waiter ) Wait (ctx context.Context , result interface {} ) error {
349+ func (w Waiter ) Wait (ctx context.Context , result any ) error {
350350 select {
351351 case <- ctx .Done ():
352352 return ctx .Err ()
@@ -380,7 +380,7 @@ type anyMessage struct {
380380}
381381
382382func (m anyMessage ) MarshalJSON () ([]byte , error ) {
383- var v interface {}
383+ var v any
384384 switch {
385385 case m .request != nil && m .response == nil :
386386 v = m .request
@@ -397,10 +397,10 @@ func (m *anyMessage) UnmarshalJSON(data []byte) error {
397397 // The presence of these fields distinguishes between the 2
398398 // message types.
399399 type msg struct {
400- ID interface {} `json:"id"`
400+ ID any `json:"id"`
401401 Method * string `json:"method"`
402402 Result anyValueWithExplicitNull `json:"result"`
403- Error interface {} `json:"error"`
403+ Error any `json:"error"`
404404 }
405405
406406 var isRequest , isResponse bool
@@ -441,7 +441,7 @@ func (m *anyMessage) UnmarshalJSON(data []byte) error {
441441 }
442442 }
443443
444- var v interface {}
444+ var v any
445445 switch {
446446 case isRequest && ! isResponse :
447447 v = & m .request
@@ -461,7 +461,7 @@ func (m *anyMessage) UnmarshalJSON(data []byte) error {
461461// {"result":null} by anyMessage's JSON unmarshaler.
462462type anyValueWithExplicitNull struct {
463463 null bool // JSON "null"
464- value interface {}
464+ value any
465465}
466466
467467func (v anyValueWithExplicitNull ) MarshalJSON () ([]byte , error ) {
0 commit comments