INNER CODE UNIT · Go
ebuf
boz/kail · buffer.go:28
ebuf = make([]byte, plen+end)
copy(ebuf, b.prev.Bytes())
copy(ebuf[plen:], log[:end])
b.prev.Reset()
} else {
ebuf = make([]byte, end)
copy(ebuf, log[:end])
}
events = append(events, newEvent(b.source, ebuf))
log = log[end+1:]
}
if sz := len(log); sz > 0 {
b.prev.Write(log)
if plen := b.prev.Len(); plen >= bufferMaxRetainSize {
ebuf := make([]byte, plen)
copy(ebuf, b.prev.Bytes())