Skip to content

Commit 1dd2231

Browse files
committed
Code review changes
1 parent b6617ec commit 1dd2231

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

clientconn.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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)

resolver/resolver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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().
326326
type 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.

0 commit comments

Comments
 (0)