File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed
Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff 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//
Original file line number Diff line number Diff 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 ) {
Original file line number Diff line number Diff 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.
285285func (t Target ) String () string {
286286 return t .URL .Scheme + "://" + t .URL .Host + "/" + t .Endpoint ()
287287}
You can’t perform that action at this time.
0 commit comments