MCPcopy Create free account
hub / github.com/golang/appengine / urlString

Function urlString

urlfetch/urlfetch.go:111–118  ·  view source on GitHub ↗

urlString returns a valid string given a URL. This function is necessary because the String method of URL doesn't correctly handle URLs with non-empty Opaque values. See http://code.google.com/p/go/issues/detail?id=4860.

(u *url.URL)

Source from the content-addressed store, hash-verified

109// the String method of URL doesn't correctly handle URLs with non-empty Opaque values.
110// See http://code.google.com/p/go/issues/detail?id=4860.
111func urlString(u *url.URL) string {
112 if u.Opaque == "" || strings.HasPrefix(u.Opaque, "//") {
113 return u.String()
114 }
115 aux := *u
116 aux.Opaque = "//" + aux.Host + aux.Opaque
117 return aux.String()
118}
119
120// RoundTrip issues a single HTTP request and returns its response. Per the
121// http.RoundTripper interface, RoundTrip only returns an error if there

Callers 1

RoundTripMethod · 0.70

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…