]> Cypherpunks repositories - gostls13.git/commit
net/http: fix confusing shadowing in ProxyFromEnvironment
authorBrad Fitzpatrick <bradfitz@golang.org>
Thu, 20 Jun 2013 18:58:24 +0000 (11:58 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 20 Jun 2013 18:58:24 +0000 (11:58 -0700)
commit5b0bf9db8e0d735551ecec40cc374121b6e6a6ba
tree00ad0b20d77c7735571e75d00648c3ce4c685157
parent3e710c0ba5da11da873c44bd9ca29786aefd1363
net/http: fix confusing shadowing in ProxyFromEnvironment

The old code worked, somewhat on accident, but was confusing,
and had a useless assignment to the inner err. It worked
because url.Parse parses just about anything, so the outer err
was always nil, so it always fell through to the bottom return
statement, even without the "err = nil" line.

Instead, just have two return statements, and add a comment.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/10448044
src/pkg/net/http/transport.go