Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check if newline is already present. #3

Open
github-actions bot opened this issue Apr 9, 2021 · 0 comments
Open

check if newline is already present. #3

github-actions bot opened this issue Apr 9, 2021 · 0 comments
Labels

Comments

@github-actions
Copy link

github-actions bot commented Apr 9, 2021

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

@github-actions github-actions bot added the todo label Apr 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

0 participants