From: Brad Fitzpatrick Date: Fri, 1 Dec 2017 17:00:58 +0000 (+0000) Subject: net/url: document Parse more X-Git-Tag: go1.10beta1~49 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=ea0d2c14f8010f31dc7b892e6a546cfdb4d8ef21;p=gostls13.git 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/81436 Reviewed-by: Ian Lance Taylor --- diff --git a/src/net/url/url.go b/src/net/url/url.go index bb44be3117..b2de6d6319 100644 --- a/src/net/url/url.go +++ b/src/net/url/url.go @@ -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)