It's kind of a race and it depends on the sizes of all the participating buffers.  It would be hard to produce on purpose, but if the last few bytes are in the buffer and the connection goes haywire, `Flush` will produce an error.

It should probably fail immediately on error.  Either a defer or a break would do the trick.  Realistically, it's 99% going to produce the same error.