MCPcopy
hub / github.com/uber-go/zap / TrimNewline

Method TrimNewline

buffer/buffer.go:133–139  ·  view source on GitHub ↗

TrimNewline trims any final "\n" byte from the end of the buffer.

()

Source from the content-addressed store, hash-verified

131
132// TrimNewline trims any final "\n" byte from the end of the buffer.
133func (b *Buffer) TrimNewline() {
134 if i := len(b.bs) - 1; i >= 0 {
135 if b.bs[i] == '\n' {
136 b.bs = b.bs[:i]
137 }
138 }
139}
140
141// Free returns the Buffer to its Pool.
142//

Callers 1

encodeReflectedMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected