bytes: document that Buffer values must not be copied

Change-Id: If0821a2af987b78ed8024b40d9ffa68032518b22
Reviewed-on: https://go-review.googlesource.com/12572
Reviewed-by: Robert Griesemer <gri@golang.org>
This commit is contained in:
Alan Donovan 2015-07-23 12:07:58 -04:00
parent 2584974d16
commit b1177d390c

View file

@ -14,6 +14,7 @@ import (
// A Buffer is a variable-sized buffer of bytes with Read and Write methods.
// The zero value for Buffer is an empty buffer ready to use.
// Buffer values must not be copied.
type Buffer struct {
buf []byte // contents are the bytes buf[off : len(buf)]
off int // read at &buf[off], write at &buf[len(buf)]