From ea79b82e92500150ada833892507bba9a9c63761 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Thu, 14 May 2009 13:39:17 -0700 Subject: [PATCH] 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 --- src/lib/io/bytebuffer.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lib/io/bytebuffer.go b/src/lib/io/bytebuffer.go index 88371c4b7a..bc6a73741b 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]; -- 2.50.0