1
0
mirror of https://github.com/golang/go synced 2024-11-19 11:14:47 -07:00

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 <iant@golang.org>
This commit is contained in:
Brad Fitzpatrick 2017-11-29 21:15:31 +00:00
parent a631daba5f
commit ed8b7dedd3

View 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 // String returns the contents of the unread portion of the buffer
// as a string. If the Buffer is a nil pointer, it returns "<nil>". // 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 { func (b *Buffer) String() string {
if b == nil { if b == nil {
// Special case, useful in debugging. // Special case, useful in debugging.