good morning!!!!

Skip to content
Snippets Groups Projects
Commit b55ad07e authored by a's avatar a
Browse files

edit helpers

parent 845854c0
No related branches found
No related tags found
No related merge requests found
......@@ -2,11 +2,20 @@ package jrpc
import "context"
func Do[T any](ctx context.Context, c Conn, method string, args any) (T, error) {
func Do[T any](ctx context.Context, c Conn, method string, args any) (*T, error) {
var t T
err := c.Do(ctx, t, method, args)
err := c.Do(ctx, &t, method, args)
if err != nil {
return t, err
return nil, err
}
return t, nil
return &t, nil
}
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)
if err != nil {
return nil, err
}
return &t, nil
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment