From 3575d42a309234613d70b1abc62a15266e0d4a77 Mon Sep 17 00:00:00 2001 From: Matt Straathof <11823378+bruuuuuuuce@users.noreply.github.com> Date: Wed, 28 Feb 2024 14:04:49 -0800 Subject: [PATCH] chore: expose `NewClient` method to end users This will allow users to create a connection, leaving it in idle state, rather than having it automatically try and connect in the background, which is the current behavior of `Dial`. Leaving the connection in idle state is more consistent with how other grpc implementations deal with connections --- clientconn.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clientconn.go b/clientconn.go index 6a44343aea00..72790c6e9788 100644 --- a/clientconn.go +++ b/clientconn.go @@ -117,8 +117,8 @@ func (dcs *defaultConfigSelector) SelectConfig(rpcInfo iresolver.RPCInfo) (*ires }, nil } -// newClient returns a new client in idle mode. -func newClient(target string, opts ...DialOption) (conn *ClientConn, err error) { +// NewClient returns a new client in idle mode. +func NewClient(target string, opts ...DialOption) (conn *ClientConn, err error) { cc := &ClientConn{ target: target, conns: make(map[*addrConn]struct{}),