Skip to content

Commit dfd296f

Browse files
committed
Responded to Doug's comments
1 parent 22be8b4 commit dfd296f

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

clientconn.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,7 @@ func (cc *ClientConn) channelzMetric() *channelz.ChannelInternalMetric {
883883
}
884884
}
885885

886-
// Target returns the canonicalized target string of the ClientConn.
886+
// Target returns the canonical target string of the ClientConn.
887887
//
888888
// # Experimental
889889
//

clientconn_test.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -820,15 +820,20 @@ func (s) TestClientConn_Target(t *testing.T) {
820820
targetWant: "dns://a.server.com/google.com",
821821
},
822822
{
823-
name: "canonicalized-target-not-specified",
823+
name: "canonical-target-not-specified",
824824
addr: "no.scheme",
825825
targetWant: "passthrough:///no.scheme",
826826
},
827827
{
828-
name: "canonicalized-target-nonexistent",
828+
name: "canonical-target-nonexistent",
829829
addr: "nonexist:///non.existent",
830830
targetWant: "passthrough:///nonexist:///non.existent",
831831
},
832+
{
833+
name: "canonical-target-add-colon-slash",
834+
addr: "dns:hostname:port",
835+
targetWant: "dns:///hostname:port",
836+
},
832837
}
833838
for _, test := range tests {
834839
t.Run(test.name, func(t *testing.T) {

resolver/resolver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ func (t Target) Endpoint() string {
281281
return strings.TrimPrefix(endpoint, "/")
282282
}
283283

284-
// String returns a string representation of Target.
284+
// String returns a canonical string representation of Target.
285285
func (t Target) String() string {
286286
return t.URL.Scheme + "://" + t.URL.Host + "/" + t.Endpoint()
287287
}

0 commit comments

Comments
 (0)