Skip to content

check if newline is already present. #3

Open
@github-actions

Description

@github-actions

check if newline is already present.

// # TODO: check if newline is already present.

}

// 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions