Skip to content

Commit

Permalink
net/url: document Parse more
Browse files Browse the repository at this point in the history
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/81436
Reviewed-by: Ian Lance Taylor <iant@golang.org>
  • Loading branch information
bradfitz committed Dec 1, 2017
1 parent 22b4c83 commit ea0d2c1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/net/url/url.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ea0d2c1

Please sign in to comment.