type LineDelimiter … // NewLineDelimiter allocates a new io.Writer that will split input on lines // and bracket each line with the delimiter string. This can be useful in // output tests where it is difficult to see and test trailing whitespace. func NewLineDelimiter(output io.Writer, delimiter string) *LineDelimiter { … } // Write writes buf to the LineDelimiter ld. The only errors returned are ones // encountered while writing to the underlying output stream. func (ld *LineDelimiter) Write(buf []byte) (n int, err error) { … } // Flush all lines up until now. This will assume insert a linebreak at the current point of the stream. func (ld *LineDelimiter) Flush() (err error) { … }