Commit ea0d2c14 authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

net/url: document Parse more

That Parse doesn't parse ("foo.com/path" or "foo.com:443/path") has
become something of a FAQ.

Updates #19779
Updates #21415
Updates #22955

Change-Id: Ib68efddb67f59b1374e8ed94effd4a326988dee7
Reviewed-on: https://go-review.googlesource.com/81436Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
parent 22b4c835
......@@ -441,7 +441,11 @@ func split(s string, c string, cutc bool) (string, string) {
}
// Parse parses rawurl into a URL structure.
// The rawurl may be relative or absolute.
//
// The rawurl may be relative (a path, without a host) or absolute
// (starting with a scheme). Trying to parse a hostname and path
// without a scheme is invalid but may not necessarily return an
// error, due to parsing ambiguities.
func Parse(rawurl string) (*URL, error) {
// Cut off #frag
u, frag := split(rawurl, "#", true)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment