func (lines *Buffer) Write(dest io.Writer) error {
	_, err := dest.Write(lines.buf.Bytes())
	if err != nil {
		return err
	}
	lines.buf.Truncate(0)

	return err
}
// Write writes all lines written to
// the buffer so far in a io.Writer.
//
// If if the write operation succeed, Write
// truncates the internal lines buffer, so that
// you can recycle the same Buffer as if it
// was newly created.
//
// If an error occurrs during the writing,
// no truncation of the buffer is done, so that you can
// retry the method call later.
Write writes all lines written to
the buffer so far in a io.Writer.

If if the write operation succeed, Write
truncates the internal lines buffer, so that
you can recycle the same Buffer as if it
was newly created.

If an error occurrs during the writing,
no truncation of the buffer is done, so that you can
retry the method call later.
// Write writes all lines written to // the buffer so far in a io . Writer . // // If if the write operation succeed Write // truncates the internal lines buffer so that // you can recycle the same Buffer as if it // was newly created . // // If an error occurrs during the writing // no truncation of the buffer is done so that you can // retry the method call later .
func (lines *Buffer) Write(dest io.Writer) error {
	_, err := dest.Write(lines.buf.Bytes())
	if err != nil {
		return err
	}
	lines.buf.Truncate(0)
	return err
}
func ( lines * Buffer ) Write ( dest io . Writer ) error { _ , err := dest . Write ( lines . buf . Bytes ( ) ) if err != nil { return err } lines . buf . Truncate ( 0 ) return err }
Write writes all lines written to
the buffer so far in a io.Writer.
Write writes all lines written to the buffer so far in a io . Writer .