LGTM On Mon, Oct 6, 2014 at 12:43 PM, <rsc@golang.org> wrote: > Reviewers: golang-codereviews, > ...
9 years, 7 months ago
(2014-10-06 19:46:49 UTC)
#2
LGTM
On Mon, Oct 6, 2014 at 12:43 PM, <rsc@golang.org> wrote:
> Reviewers: golang-codereviews,
>
> Message:
> Hello golang-codereviews@googlegroups.com (cc: adg, bradfitz, iant),
>
> I'd like you to review this change to
> https://code.google.com/p/go/
>
>
> Description:
> net/url: document result of String
>
> Fixes issue 8742.
>
> Please review this at https://codereview.appspot.com/155910043/
>
> Affected files (+18, -0 lines):
> M src/net/url/url.go
>
>
> Index: src/net/url/url.go
> ===================================================================
> --- a/src/net/url/url.go
> +++ b/src/net/url/url.go
> @@ -441,6 +441,24 @@
> }
>
> // String reassembles the URL into a valid URL string.
> +// The general form of the result is one of:
> +//
> +// scheme:opaque
> +// scheme://userinfo@host/path?query#fragment
> +//
> +// If u.Opaque is non-empty, String uses the first form;
> +// otherwise it uses the second form.
> +//
> +// In the second form, the following rules apply:
> +// - if u.Scheme is empty, scheme: is omitted.
> +// - if u.User is nil, userinfo@ is omitted.
> +// - if u.Host is empty, host/ is omitted.
> +// - if u.Scheme and u.Host are empty and u.User is nil,
> +// the entire scheme://userinfo@host/ is omitted.
> +// - if u.Host is non-empty and u.Path begins with a /,
> +// the form host/path does not add its own /.
> +// - if u.RawQuery is empty, ?query is omitted.
> +// - if u.Fragment is empty, #fragment is omitted.
> func (u *URL) String() string {
> var buf bytes.Buffer
> if u.Scheme != "" {
>
>
>
Issue 155910043: code review 155910043: net/url: document result of String
(Closed)
Created 9 years, 7 months ago by rsc
Modified 9 years, 7 months ago
Reviewers:
Base URL:
Comments: 0