From 1a79a7e346017f7dd2a8508d98b2bd357eb7e472 Mon Sep 17 00:00:00 2001 From: Menghan Li Date: Tue, 27 Sep 2016 11:14:33 -0700 Subject: [PATCH] Use creds.Clone in balancer.start --- clientconn.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/clientconn.go b/clientconn.go index e18d9659..11dce44f 100644 --- a/clientconn.go +++ b/clientconn.go @@ -288,8 +288,12 @@ func DialContext(ctx context.Context, target string, opts ...DialOption) (conn * // Connect to target directly if balancer is nil. addrs = append(addrs, Address{Addr: target}) } else { + var credsClone credentials.TransportCredentials + if creds != nil { + credsClone = creds.Clone() + } config := BalancerConfig{ - DialCreds: creds, + DialCreds: credsClone, } if err := cc.dopts.balancer.Start(target, config); err != nil { waitC <- err