Close HTTP client request body to prevent memory leaks.

This commit is contained in:
Adrian Gallagher
2015-03-14 16:03:05 +11:00
parent 2e13fae287
commit 6e6542001a
11 changed files with 14 additions and 14 deletions

View File

@@ -94,6 +94,7 @@ func CalculateNetProfit(amount, priceThen, priceNow, costs float64) (float64) {
func SendHTTPRequest(url string, jsonDecode bool, result interface{}) (err error) {
res, err := http.Get(url)
defer res.Body.Close()
if err != nil {
log.Println(err)