Skip to content

Commit

Permalink
bytes: mention strings.Builder in Buffer.String docs
Browse files Browse the repository at this point in the history
Fixes #22778

Change-Id: I37f7a59c15828aa720fe787fff42fb3ef17729c7
Reviewed-on: https://go-review.googlesource.com/80815
Reviewed-by: Ian Lance Taylor <iant@golang.org>
  • Loading branch information
bradfitz committed Nov 30, 2017
1 parent a631dab commit ed8b7de
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/bytes/buffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit ed8b7de

Please sign in to comment.