On 2012/11/21 03:34:43, bradfitz wrote:
But why is this comment up here? It should be after the b.Buffered() != 0
check, right?
But why is this comment up here? It should be after the b.Buffered() != 0
check, right?
if block, not just the != 0 block, but I can easily see the opposite.
https://codereview.appspot.com/6842078/diff/5001/src/pkg/bufio/bufio.go#newcode581
src/pkg/bufio/bufio.go:581: if err = b.Flush(); err1 != nil {
this is misleading. if you really want this behavior, you'd put "err =
b.Flush()" inside the if body, not in the initializer. the idiom is you check
the variable you declared in the condition, but here you don't. you
check err1
instead of err.
This is a bug that the tests are not catching. I'm adding tests for thisthis is misleading. if you really want this behavior, you'd put "err =
b.Flush()" inside the if body, not in the initializer. the idiom is you check
the variable you declared in the condition, but here you don't. you
check err1
instead of err.
section now. Thank you for catching this.
https://codereview.appspot.com/6842078/diff/5001/src/pkg/bufio/bufio.go#newcode612
src/pkg/bufio/bufio.go:612: if err == io.EOF || err ==
io.ErrUnexpectedEOF {
why?
I touch on this earlier in the code, should I repeat the comment?io.ErrUnexpectedEOF {
why?
https://codereview.appspot.com/6842078/