summaryrefslogtreecommitdiff
path: root/libgo/go/strings/builder.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/strings/builder.go')
-rw-r--r--libgo/go/strings/builder.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/libgo/go/strings/builder.go b/libgo/go/strings/builder.go
index ac58f34e1de..3f33a875087 100644
--- a/libgo/go/strings/builder.go
+++ b/libgo/go/strings/builder.go
@@ -50,6 +50,11 @@ func (b *Builder) String() string {
// Len returns the number of accumulated bytes; b.Len() == len(b.String()).
func (b *Builder) Len() int { return len(b.buf) }
+// Cap returns the capacity of the builder's underlying byte slice. It is the
+// total space allocated for the string being built and includes any bytes
+// already written.
+func (b *Builder) Cap() int { return cap(b.buf) }
+
// Reset resets the Builder to be empty.
func (b *Builder) Reset() {
b.addr = nil