summaryrefslogtreecommitdiff
path: root/src/lib/io/bytebuffer.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-05-14 13:39:17 -0700
committerRuss Cox <rsc@golang.org>2009-05-14 13:39:17 -0700
commitf721d315a926be68063c2a53b6a6e90798fe8bbb (patch)
tree04dd225d8309828ea3c19ba0c4c12965d4b4b25c /src/lib/io/bytebuffer.go
parentec1e46e05d05b25dba7347eac9548bbe9254fbd5 (diff)
downloadgolang-f721d315a926be68063c2a53b6a6e90798fe8bbb.tar.gz
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
Diffstat (limited to 'src/lib/io/bytebuffer.go')
-rw-r--r--src/lib/io/bytebuffer.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/lib/io/bytebuffer.go b/src/lib/io/bytebuffer.go
index 88371c4b7..bc6a73741 100644
--- a/src/lib/io/bytebuffer.go
+++ b/src/lib/io/bytebuffer.go
@@ -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];