From 6e10589ce691ba1a78f094739e68f704a351108e Mon Sep 17 00:00:00 2001 From: w-h-a Date: Sat, 21 Sep 2024 17:58:03 -0700 Subject: [PATCH] refactor: clients now --- client/grpcclient/grpc_client.go | 4 ---- client/httpclient/http_client.go | 4 ---- sidecar/custom/sidecar.go | 2 +- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/client/grpcclient/grpc_client.go b/client/grpcclient/grpc_client.go index e39fba1..5d7b81c 100644 --- a/client/grpcclient/grpc_client.go +++ b/client/grpcclient/grpc_client.go @@ -38,10 +38,6 @@ func (c *grpcClient) Call(ctx context.Context, req client.Request, rsp interface return errorutils.InternalServerError("client", "req is nil") } - if rsp == nil { - return errorutils.InternalServerError("client", "rsp is nil") - } - callOptions := client.NewCallOptions(&c.options.CallOptions, opts...) next, err := c.next(req, callOptions) diff --git a/client/httpclient/http_client.go b/client/httpclient/http_client.go index ba129ec..a824bb3 100644 --- a/client/httpclient/http_client.go +++ b/client/httpclient/http_client.go @@ -38,10 +38,6 @@ func (c *httpClient) Call(ctx context.Context, req client.Request, rsp interface return errorutils.InternalServerError("client", "req is nil") } - if rsp == nil { - return errorutils.InternalServerError("client", "rsp is nil") - } - callOptions := client.NewCallOptions(&c.options.CallOptions, opts...) next, err := c.next(req, callOptions) diff --git a/sidecar/custom/sidecar.go b/sidecar/custom/sidecar.go index 4ee03db..3ff47c6 100644 --- a/sidecar/custom/sidecar.go +++ b/sidecar/custom/sidecar.go @@ -227,7 +227,7 @@ func (s *customSidecar) sendEventToService(event *sidecar.Event) error { req := s.options.Client.NewRequest(opts...) - rsp := &sidecar.Event{} + var rsp interface{} if err := s.options.Client.Call(context.Background(), req, rsp, client.CallWithAddress(url)); err != nil { return err