gopencils
gopencils copied to clipboard
close connection after reading the body
This closes the connection after reading from the body, otherwise too many open files error pops up when making a lot of requests.
http://craigwickesser.com/2015/01/golang-http-to-many-open-files/
You can also read the godoc that refers to Response.Close property for details:
// Close records whether the header directed that the connection be
// closed after reading Body. The value is advice for clients: neither
// ReadResponse nor Response.Write ever closes a connection.
Close bool