diff options
Diffstat (limited to 'llgo/third_party/gofrontend/libgo/go/bytes/buffer.go')
| -rw-r--r-- | llgo/third_party/gofrontend/libgo/go/bytes/buffer.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llgo/third_party/gofrontend/libgo/go/bytes/buffer.go b/llgo/third_party/gofrontend/libgo/go/bytes/buffer.go index 46ca1d5ad3f..4db93867d9a 100644 --- a/llgo/third_party/gofrontend/libgo/go/bytes/buffer.go +++ b/llgo/third_party/gofrontend/libgo/go/bytes/buffer.go @@ -56,6 +56,10 @@ func (b *Buffer) String() string { // b.Len() == len(b.Bytes()). func (b *Buffer) Len() int { return len(b.buf) - b.off } +// Cap returns the capacity of the buffer's underlying byte slice, that is, the +// total space allocated for the buffer's data. +func (b *Buffer) Cap() int { return cap(b.buf) } + // Truncate discards all but the first n unread bytes from the buffer. // It panics if n is negative or greater than the length of the buffer. func (b *Buffer) Truncate(n int) { |

