]> Cypherpunks repositories - gostls13.git/commitdiff
bytes: mention strings.Builder in Buffer.String docs
authorBrad Fitzpatrick <bradfitz@golang.org>
Wed, 29 Nov 2017 21:15:31 +0000 (21:15 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 30 Nov 2017 01:46:50 +0000 (01:46 +0000)
Fixes #22778

Change-Id: I37f7a59c15828aa720fe787fff42fb3ef17729c7
Reviewed-on: https://go-review.googlesource.com/80815
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/bytes/buffer.go

index 67771846fc492d03c367bb2a0b30bf969932c76b..dc9d5e95d32ba1c457bbf12e6e011f493397da0b 100644 (file)
@@ -56,6 +56,8 @@ func (b *Buffer) Bytes() []byte { return b.buf[b.off:] }
 
 // String returns the contents of the unread portion of the buffer
 // as a string. If the Buffer is a nil pointer, it returns "<nil>".
+//
+// To build strings more efficiently, see the strings.Builder type.
 func (b *Buffer) String() string {
        if b == nil {
                // Special case, useful in debugging.