]> Cypherpunks repositories - gostls13.git/commit
net/url: make URL implement encoding.BinaryMarshaler, BinaryUnmarshaler
authorRuss Cox <rsc@golang.org>
Wed, 19 Oct 2016 18:06:54 +0000 (14:06 -0400)
committerBrad Fitzpatrick <bradfitz@golang.org>
Sat, 22 Oct 2016 17:20:21 +0000 (17:20 +0000)
commit659570915481c87559f0197c9980e8cbac8e2c33
treec5e3a73067f747b023791f8b35849a52444b1589
parent6eae03e136f031649683d359a0879f6d6ae5e023
net/url: make URL implement encoding.BinaryMarshaler, BinaryUnmarshaler

This makes it possible to use URLs with gob.

Ideally we'd also implement TextMarshaler and TextUnmarshaler,
but that would change the JSON encoding of a URL from something like:

{"Scheme":"https","Opaque":"","User":null,"Host":"www.google.com","Path":"/x","RawPath":"","ForceQuery":false,"RawQuery":"y=z","Fragment":""}

to something like:

"https://www.google.com/x?y=z"

That'd be nice, but it would break code expecting the old form.

Fixes #10964.

Change-Id: I83f06bc2bedd2ba8a5d8eef03ea0056d045c258f
Reviewed-on: https://go-review.googlesource.com/31467
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/net/url/url.go
src/net/url/url_test.go