From 5ab3e7e90b222d35a97cabde0a0d84d1b1e61e62 Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Mon, 8 Jul 2019 08:01:42 +0100 Subject: [PATCH] Remove Port from registry --- grpc.go | 6 ------ grpc_test.go | 4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/grpc.go b/grpc.go index 809eec2..e79b540 100644 --- a/grpc.go +++ b/grpc.go @@ -84,9 +84,6 @@ func (g *grpcClient) next(request client.Request, opts client.CallOptions) (sele func (g *grpcClient) call(ctx context.Context, node *registry.Node, req client.Request, rsp interface{}, opts client.CallOptions) error { address := node.Address - if node.Port > 0 { - address = fmt.Sprintf("%s:%d", address, node.Port) - } header := make(map[string]string) if md, ok := metadata.FromContext(ctx); ok { @@ -146,9 +143,6 @@ func (g *grpcClient) call(ctx context.Context, node *registry.Node, req client.R func (g *grpcClient) stream(ctx context.Context, node *registry.Node, req client.Request, opts client.CallOptions) (client.Stream, error) { address := node.Address - if node.Port > 0 { - address = fmt.Sprintf("%s:%d", address, node.Port) - } header := make(map[string]string) if md, ok := metadata.FromContext(ctx); ok { diff --git a/grpc_test.go b/grpc_test.go index 7c58fd4..3652ec6 100644 --- a/grpc_test.go +++ b/grpc_test.go @@ -2,6 +2,7 @@ package grpc import ( "context" + "fmt" "net" "strconv" "strings" @@ -50,8 +51,7 @@ func TestGRPCClient(t *testing.T) { Nodes: []*registry.Node{ ®istry.Node{ Id: "test-1", - Address: addr, - Port: port, + Address: fmt.Sprintf("%s:%d", addr, port), }, }, })