From 0c6945cf66e2cd24523545a33d1628219bcf3dd1 Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Thu, 4 Jun 2009 15:28:09 -0700 Subject: use the new bytes package R=rsc DELTA=61 (8 added, 31 deleted, 22 changed) OCL=29897 CL=29899 --- src/lib/bytes/bytes.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/lib/bytes/bytes.go') diff --git a/src/lib/bytes/bytes.go b/src/lib/bytes/bytes.go index a64b07b74..dd299a82e 100644 --- a/src/lib/bytes/bytes.go +++ b/src/lib/bytes/bytes.go @@ -43,11 +43,12 @@ func Equal(a, b []byte) bool { // Copy copies the source to the destination, stopping when the source // is all transferred. The caller must guarantee that there is enough -// room in the destination. -func Copy(dst, src []byte) { +// room in the destination. It returns the number of bytes copied +func Copy(dst, src []byte) int { for i, x := range src { dst[i] = x } + return len(src) } // Explode splits s into an array of UTF-8 sequences, one per Unicode character (still arrays of bytes). -- cgit v1.2.3