diff options
| author | Brad Fitzpatrick <bradfitz@golang.org> | 2017-11-29 21:15:31 +0000 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@golang.org> | 2017-11-30 01:46:50 +0000 |
| commit | ed8b7dedd35c479bd56ab4dd2dd2671727db464c (patch) | |
| tree | 2723bf4e6de7cfa6ca074a3ed0404eea4fd8070a /src/bytes | |
| parent | a631daba5fe9d91ebdddd4148e8af82e07c1ae3e (diff) | |
| download | go-ed8b7dedd35c479bd56ab4dd2dd2671727db464c.tar.xz | |
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>
Diffstat (limited to 'src/bytes')
| -rw-r--r-- | src/bytes/buffer.go | 2 |
1 files changed, 2 insertions, 0 deletions
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 "<nil>". +// +// To build strings more efficiently, see the strings.Builder type. func (b *Buffer) String() string { if b == nil { // Special case, useful in debugging. |
