FAQ
Sorry for the slow review. Kick me in the future if you want my
attention.


https://codereview.appspot.com/6653049/diff/2001/src/pkg/net/http/client.go
File src/pkg/net/http/client.go (right):

https://codereview.appspot.com/6653049/diff/2001/src/pkg/net/http/client.go#newcode90
src/pkg/net/http/client.go:90: func handleCookiesAndSend(jar CookieJar,
req *Request, transport RoundTripper) (resp *Response, err error) {
since CookieJar and RoundTripper both always come from the Client
anyway, maybe just make this a private method on *Client?

func (c *Client) cookieSend(req *Request) (*Response, error)

(and I have a slight preference for not naming the result parameters,
for clarity in the return statements below)

https://codereview.appspot.com/6653049/diff/2001/src/pkg/net/http/client.go#newcode97
src/pkg/net/http/client.go:97: if err == nil && jar != nil {
more idiomatic would be to return early on error.

if err != nil {
return nil, err
}

https://codereview.appspot.com/6653049/diff/2001/src/pkg/net/http/client.go#newcode98
src/pkg/net/http/client.go:98: jar.SetCookies(req.URL, resp.Cookies())
most the time this jar will be a blackHoleJar, which means we waste time
parsing cookies in resp.Cookies() just to throw them away, so maybe we
should ditch blackHoleJar, once this is a method on Client and we have
the jar == nil checks anyway

https://codereview.appspot.com/6653049/diff/2001/src/pkg/net/http/client.go#newcode233
src/pkg/net/http/client.go:233: jar = blackHoleJar{}
perhaps we should get rid of this now

https://codereview.appspot.com/6653049/

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-dev @
categoriesgo
postedOct 29, '12 at 11:31a
activeOct 29, '12 at 4:56p
posts10
users2
websitegolang.org

2 users in discussion

Filemon: 6 posts Bradfitz: 4 posts

People

Translate

site design / logo © 2022 Grokbase