From d4e9829096c4a6d2138e664aa0a8bca69e60e228 Mon Sep 17 00:00:00 2001 From: Yusuke Kato Date: Fri, 4 Oct 2024 16:07:10 +0900 Subject: [PATCH 1/2] Refactor internal/net/grpc/client.go (#2674) Signed-off-by: kpango --- internal/net/grpc/client.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/net/grpc/client.go b/internal/net/grpc/client.go index d5aef913ec..2abd84901c 100644 --- a/internal/net/grpc/client.go +++ b/internal/net/grpc/client.go @@ -19,7 +19,9 @@ package grpc import ( "context" + "maps" "math" + "slices" "sync/atomic" "time" @@ -155,11 +157,15 @@ func (g *gRPCClient) StartConnectionMonitor(ctx context.Context) (<-chan error, } g.monitorRunning.Store(true) +<<<<<<< HEAD addrs := make([]string, len(g.addrs)) for addr := range g.addrs { addrs = append(addrs, addr) } +======= + addrs := slices.Collect(maps.Keys(g.addrs)) +>>>>>>> 04d0a7386 (Refactor internal/net/grpc/client.go (#2674)) if g.dialer != nil { g.dialer.StartDialerCache(ctx) } From 00ce43ff62d6521ca84196783b1cff03a5e36ee2 Mon Sep 17 00:00:00 2001 From: Yusuke Kato Date: Fri, 4 Oct 2024 17:40:30 +0900 Subject: [PATCH 2/2] Update client.go Signed-off-by: Yusuke Kato --- internal/net/grpc/client.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/internal/net/grpc/client.go b/internal/net/grpc/client.go index 2abd84901c..6409d07b1d 100644 --- a/internal/net/grpc/client.go +++ b/internal/net/grpc/client.go @@ -157,15 +157,7 @@ func (g *gRPCClient) StartConnectionMonitor(ctx context.Context) (<-chan error, } g.monitorRunning.Store(true) -<<<<<<< HEAD - addrs := make([]string, len(g.addrs)) - for addr := range g.addrs { - addrs = append(addrs, addr) - } - -======= addrs := slices.Collect(maps.Keys(g.addrs)) ->>>>>>> 04d0a7386 (Refactor internal/net/grpc/client.go (#2674)) if g.dialer != nil { g.dialer.StartDialerCache(ctx) }