Thanks Marvin, I think I understand now.
Sorry Ian I didn't even notice, but still...
I was using a net.Conn as the underlying reader. What I really needed was
the Peek() function but the documentation for Buffered() made it seem more
appropriate. I only needed to know the number of bytes received over the
connection before evicting and interpreting them.

intBytes, err := reader.Peek(4)
if err == nil {

// Decode integer

reader.Discard(4)

}

   -Sam

On Mon, Dec 16, 2019 at 7:27 AM Marvin Renich <m...@renich.org> wrote:

> * Ian Lance Taylor <i...@golang.org> [191215 23:05]:
> > The Buffered method [snip] tells you how
> > many bytes you can Read without causing a call to the underlying
> > Reader.
>
> I think this would be a significant improvement over the current
> ambiguous documentation.  It should adequately dispel any unrealistic
> expectations on the part of programmers who are reading the
> documentation.
>
> ...Marvin
>
> --
> 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/1smBsPOdFT0/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/20191216122707.4nx3gueuibk4dpua%40basil.wdw
> .
>

-- 
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/CAFr%2B4KQe%3D4B%2BHF0k9y72RaW0NYZ_N2Jvap_moWtSdWiHmbDaLQ%40mail.gmail.com.

Reply via email to