Interesting points. So I guess ReadFull can be suitable for the consuming end of those bytes.
Thank you! On Tue, Jun 9, 2020 at 11:40 PM Brian Candler <b.cand...@pobox.com> wrote: > On Tuesday, 9 June 2020 17:53:07 UTC+1, Amit Lavon wrote: >> >> Why would I ever use Reader.Read rather than ReadFull? >> >> > Because it's often more efficient to process data in the "natural" chunks > it comes in, rather than packing it out to fit a particular buffer size - > in which case the final read may be split. > > For example, with HTTP chunked encoding, I'd expect each Read to give me > one chunk - as long as it fits in the provided buffer, of course. > > -- > You received this message because you are subscribed to a topic in the > Google Groups "golang-nuts" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/golang-nuts/u-wNH3NyMHo/unsubscribe. > To unsubscribe from this group and all its topics, 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/cbfde5a8-89eb-43f3-9f2f-1259df65cb8ao%40googlegroups.com > <https://groups.google.com/d/msgid/golang-nuts/cbfde5a8-89eb-43f3-9f2f-1259df65cb8ao%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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/CAPTkDQWOFsDjDbPSgprJkpfC%2BifNKHWaP4nT9jY8hYXP_jc3Zg%40mail.gmail.com.