Open
Description
check if newline is already present.
Line 41 in 034d8da
}
// AddLineF writes a line of text in the buffer.
// The line to append is built calling `fmt.Sprintf`
// with `lineFormat` and `arguments...`
func (lines *Buffer) AddLineF(lineFormat string, arguments ...interface{}) {
line := fmt.Sprintf(lineFormat, arguments...)
lines.AddLine(line)
}
// AddLine writes a line of text in the buffer.
// A newline is appended at the end of the strigns
// only if it's not already present.
func (lines *Buffer) AddLine(line string) {
lines.buf.WriteString(line)
// # TODO: check if newline is already present.
lines.buf.WriteRune('\n')
}
673424fd12fd94348520b58125bf662e799d2bd8