From 87ceb0cec73b93064be4b65da6bee265addc2027 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Fri, 13 Jan 2012 11:48:57 -0800 Subject: [PATCH] bytes: make Write and WriteString code look the same R=golang-dev, r CC=golang-dev https://golang.org/cl/5540056 --- src/pkg/bytes/buffer.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pkg/bytes/buffer.go b/src/pkg/bytes/buffer.go index 066023a3ec..77757af1d8 100644 --- a/src/pkg/bytes/buffer.go +++ b/src/pkg/bytes/buffer.go @@ -97,8 +97,7 @@ func (b *Buffer) grow(n int) int { func (b *Buffer) Write(p []byte) (n int, err error) { b.lastRead = opInvalid m := b.grow(len(p)) - copy(b.buf[m:], p) - return len(p), nil + return copy(b.buf[m:], p), nil } // WriteString appends the contents of s to the buffer. The return