Closed
Description
by ucgggg:
What does 'go version' print? go version go1.2.1 linux/amd64 What steps reproduce the problem? 1. run http://play.golang.org/p/2EVI4La_Fp What happened? The memory exhausted quickly. Please provide any additional information below. ################ net\http\client.go: ################ func send(req *Request, t RoundTripper) (resp *Response, err error) { ....... resp, err = t.RoundTrip(req) if err != nil { if resp != nil { log.Printf("RoundTripper returned a response & error; ignoring response") } return nil, err } } ################ If "err!=nil", the "resp" will be ignored. But the resp.Body should be closed if not nil: if resp != nil { log.Printf("RoundTripper returned a response & error; ignoring response") if resp.Body != nil { resp.Body.Close() } }