There is io.ReadFull <https://golang.org/pkg/io/#ReadFull> if you want to 
read as much as it can into the preallocated buffer; you'll get 
io.ErrUnexpectedEOF if it's less than this.
https://play.golang.org/p/gIAX046vNvW

There is ioutil.ReadAll <https://golang.org/pkg/io/ioutil/#ReadAll> if you 
want to allocate memory to read the entire stream into a single buffer 
(assuming you have enough RAM) 
https://play.golang.org/p/Pg17S6A74SN

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/8ff054df-218c-4d52-8984-83b1c4444ed9o%40googlegroups.com.

Reply via email to