Skip to content

Commit

Permalink
fixup! Add Buffer.TrimNewline
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua T Corbin committed Jun 18, 2018
1 parent e9efbe5 commit ae8d2a1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions buffer/buffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ func (b *Buffer) Write(bs []byte) (int, error) {
return len(bs), nil
}

// TrimNewline trims any final "\n" byte from the end of the buffer.
func (b *Buffer) TrimNewline() {
if i := len(b.bs) - 1; i >= 0 {
if b.bs[i] == '\n' {
Expand Down

0 comments on commit ae8d2a1

Please # to comment.