|
|
@ -276,6 +276,9 @@ func (c *Client) Call(result interface{}, method string, args ...interface{}) er |
|
|
|
// The result must be a pointer so that package json can unmarshal into it. You
|
|
|
|
// The result must be a pointer so that package json can unmarshal into it. You
|
|
|
|
// can also pass nil, in which case the result is ignored.
|
|
|
|
// can also pass nil, in which case the result is ignored.
|
|
|
|
func (c *Client) CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error { |
|
|
|
func (c *Client) CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error { |
|
|
|
|
|
|
|
if result != nil && reflect.TypeOf(result).Kind() != reflect.Ptr { |
|
|
|
|
|
|
|
return fmt.Errorf("call result parameter must be pointer or nil interface: %v", result) |
|
|
|
|
|
|
|
} |
|
|
|
msg, err := c.newMessage(method, args...) |
|
|
|
msg, err := c.newMessage(method, args...) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
return err |
|
|
|