File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -1980,13 +1980,14 @@ func (cc *ClientConn) determineAuthority() error {
19801980 return fmt .Errorf ("ClientConn's authority from transport creds %q and dial option %q don't match" , authorityFromCreds , authorityFromDialOption )
19811981 }
19821982
1983+ endpoint := cc .parsedTarget .Endpoint ()
19831984 if authorityFromDialOption != "" {
19841985 cc .authority = authorityFromDialOption
19851986 } else if authorityFromCreds != "" {
19861987 cc .authority = authorityFromCreds
19871988 } else if auth , ok := cc .resolverBuilder .(resolver.AuthorityOverrider ); ok {
19881989 cc .authority = auth .OverrideAuthority (cc .parsedTarget )
1989- } else if endpoint := cc . parsedTarget . Endpoint (); strings .HasPrefix (endpoint , ":" ) {
1990+ } else if strings .HasPrefix (endpoint , ":" ) {
19901991 cc .authority = "localhost" + endpoint
19911992 } else {
19921993 cc .authority = encodeAuthority (endpoint )
Original file line number Diff line number Diff line change @@ -322,7 +322,7 @@ type Resolver interface {
322322
323323// AuthorityOverrider is implemented by Builders that wish to override the
324324// default authority for the ClientConn.
325- // By default, the authority used is target.Endpoint()
325+ // By default, the authority used is target.Endpoint().
326326type AuthorityOverrider interface {
327327 // OverrideAuthority returns the authority to use for a ClientConn with the
328328 // given target. It must not perform I/O or any other blocking operations.
You can’t perform that action at this time.
0 commit comments