From: Brad Fitzpatrick Date: Wed, 29 Nov 2017 21:15:31 +0000 (+0000) Subject: bytes: mention strings.Builder in Buffer.String docs X-Git-Tag: go1.10beta1~99 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=ed8b7dedd35c479bd56ab4dd2dd2671727db464c;p=gostls13.git bytes: mention strings.Builder in Buffer.String docs Fixes #22778 Change-Id: I37f7a59c15828aa720fe787fff42fb3ef17729c7 Reviewed-on: https://go-review.googlesource.com/80815 Reviewed-by: Ian Lance Taylor --- diff --git a/src/bytes/buffer.go b/src/bytes/buffer.go index 67771846fc..dc9d5e95d3 100644 --- a/src/bytes/buffer.go +++ b/src/bytes/buffer.go @@ -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 "". +// +// To build strings more efficiently, see the strings.Builder type. func (b *Buffer) String() string { if b == nil { // Special case, useful in debugging.