I'm doing a simple http.Get request where the server does not provide
a Content-Length header and as such the Response.ContentLength is set
to -1. Unfortunately this is the first time I've encountered this
problem in a language that requires the buffer that is reading the
body of a Response to have a pre-defined length. Rather than do it
badly (such as just pre-defining a massive buffer) I was hoping for an
example of the best way to handle such a problem. My best guess is to
loop through the Reader using io.ReadFull with a buffer of say 1024
bytes until io.ErrUnexpectedEOF is hit.
Thanks
--
Subscription settings:
http://groups.google.com/group/golang-nuts/subscribe?hl=en