]> Cypherpunks repositories - gostls13.git/commit
net/http: remove parseURL variable
authorDmitri Shuralyov <dmitshur@golang.org>
Mon, 21 Oct 2019 19:30:13 +0000 (15:30 -0400)
committerDmitri Shuralyov <dmitshur@golang.org>
Mon, 21 Oct 2019 20:43:40 +0000 (20:43 +0000)
commit3409ce39bfd7584523b7a8c150a310cea92d879d
tree3bb6782d0e73f973a35ffb665994f70d0d17d3db
parentd24cf6d53e854d0f7cda6912575c7054637ed53c
net/http: remove parseURL variable

The parseURL variable was introduced in CL 49930 in order to work
around the fact that the name "url" was shadowed by a parameter of
exported functions, and couldn't be renamed without sacrificing
documentation readability. Documentation readability takes higher
priority than internal implementation details.

Back then, I considered renaming the net/url import but saw that it
would be too disruptive of a change to the large net/http package.

Now I see a better way: it's possible to import net/url both as url
and as urlpkg (the package is still imported just once, but it becomes
available via two names). This way we eliminate the need for wasting
(a little) memory on the parseURL variable, improve code readability
slightly, and delete some lines of code and comments.

Updates #21077

Change-Id: I42cd9833afdcf4a5f5874fb7ee9c8c11eae557dc
Reviewed-on: https://go-review.googlesource.com/c/go/+/202482
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/net/http/request.go
src/net/http/server.go