Re: [go-nuts] Re: bufio.Reader.Buffered returns 0

2019-12-16 Thread Sam
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

Re: [go-nuts] Re: bufio.Reader.Buffered returns 0

2019-12-16 Thread Marvin Renich
* Ian Lance Taylor [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

Re: [go-nuts] Re: bufio.Reader.Buffered returns 0

2019-12-15 Thread Ian Lance Taylor
On Sun, Dec 15, 2019 at 7:56 PM wrote: > > I'm having a similar problem as the original poster. I expect Buffered() to > return the number of bytes that can be read from the current buffer, like the > documentation states. However a call to Buffered() returns 0 both before and > after a call

Re: [go-nuts] Re: bufio.Reader.Buffered returns 0

2019-12-15 Thread smoggach
I'm having a similar problem as the original poster. I expect Buffered() to return the number of bytes that can be read from the current buffer, like the documentation states. However a call to Buffered() returns 0 both before and after a call to any Read() that finds bytes in the buffer. In my