properly treat response bodies

This commit is contained in:
Stephen McQuay 2017-06-30 16:13:31 -07:00
parent acd1263604
commit 37f96365c2
No known key found for this signature in database
GPG Key ID: 1ABF428F71BAFC3D

View File

@ -2,6 +2,8 @@ package hmm
import (
"bufio"
"io"
"io/ioutil"
"net/http"
)
@ -23,6 +25,9 @@ func Lines(url string) <-chan string {
r <- s.Text()
}
// ignore errors
// if resp.StatusCode != http.StatusOK {}
io.Copy(ioutil.Discard, resp.Body)
resp.Body.Close()
}()
return r