1
0
mirror of https://github.com/golang/go synced 2024-11-20 09:44:45 -07:00

fix Truncate comment:

* make a complete sentence.
* eliminate reference to byte positions,
  which are not a concept exposed by the interface.

R=gri
DELTA=2  (0 added, 1 deleted, 1 changed)
OCL=28838
CL=28838
This commit is contained in:
Russ Cox 2009-05-14 13:39:17 -07:00
parent 28db3e8411
commit ea79b82e92

View File

@ -39,8 +39,7 @@ func (b *ByteBuffer) Len() int {
return len(b.buf) - b.off
}
// Truncates the buffer so it contains n bytes.
// It preserves the data in the buffer at positions [0 : n].
// Truncate discards all but the first n unread bytes from the buffer.
// It is an error to call b.Truncate(n) with n > b.Len().
func (b *ByteBuffer) Truncate(n int) {
b.buf = b.buf[0 : b.off + n];