MCPcopy
hub / github.com/grafana/dskit / Reset

Method Reset

log/buffered.go:147–152  ·  view source on GitHub ↗

Reset resets the buffer to be empty, but it retains the underlying storage for use by future writes. Reset is the same as Truncate(0).

()

Source from the content-addressed store, hash-verified

145// but it retains the underlying storage for use by future writes.
146// Reset is the same as Truncate(0).
147func (t *threadsafeBuffer) Reset() {
148 t.mx.Lock()
149 defer t.mx.Unlock()
150
151 t.buf.Reset()
152}
153
154// newThreadsafeBuffer returns a new threadsafeBuffer wrapping the given bytes.Buffer.
155func newThreadsafeBuffer(buf *bytes.Buffer) *threadsafeBuffer {

Callers 2

TestLazySprintfFunction · 0.45
WriteMethod · 0.45

Calls

no outgoing calls

Tested by 1

TestLazySprintfFunction · 0.36