From f4a38b7dd0625e5f70b3d088c29670d3ffd62d95 Mon Sep 17 00:00:00 2001 From: a <a@tuxpa.in> Date: Sat, 4 Mar 2023 14:37:50 -0600 Subject: [PATCH] change interface --- conn.go | 2 +- helper.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conn.go b/conn.go index 9f97eda..90fcec4 100644 --- a/conn.go +++ b/conn.go @@ -5,7 +5,7 @@ import "context" var _ Conn = (*Client)(nil) type Conn interface { - Call(ctx context.Context, result any, method string, params ...any) error + Do(ctx context.Context, result any, method string, params any) error BatchCall(ctx context.Context, b ...BatchElem) error SetHeader(key, value string) Close() error diff --git a/helper.go b/helper.go index d70ddda..6288cdc 100644 --- a/helper.go +++ b/helper.go @@ -4,7 +4,7 @@ import "context" func Do[T any](ctx context.Context, c Conn, method string, args any) (*T, error) { var t T - err := c.Call(ctx, &t, method, args) + err := c.Do(ctx, &t, method, args) if err != nil { return nil, err } @@ -13,7 +13,7 @@ func Do[T any](ctx context.Context, c Conn, method string, args any) (*T, error) func Call[T any](ctx context.Context, c Conn, method string, args ...any) (*T, error) { var t T - err := c.Call(ctx, &t, method, args) + err := c.Do(ctx, &t, method, args) if err != nil { return nil, err } -- GitLab