MCPcopy Index your code
hub / github.com/github/copilot-sdk / Bytes

Method Bytes

go/internal/truncbuffer/truncbuffer.go:52–64  ·  view source on GitHub ↗

Bytes returns a copy of the current buffer contents in order.

()

Source from the content-addressed store, hash-verified

50
51// Bytes returns a copy of the current buffer contents in order.
52func (t *TruncBuffer) Bytes() []byte {
53 t.mu.RLock()
54 defer t.mu.RUnlock()
55
56 if !t.full {
57 return append([]byte(nil), t.buf[:t.head]...)
58 }
59
60 out := make([]byte, t.size)
61 n := copy(out, t.buf[t.head:])
62 copy(out[n:], t.buf[:t.head])
63 return out
64}
65
66// String returns the buffer contents as a string.
67func (t *TruncBuffer) String() string {

Callers 8

TestTruncBuffer_ExactMaxFunction · 0.95
StringMethod · 0.95
drainBodyFunction · 0.80

Calls

no outgoing calls