diff options
| author | Rob Pike <r@golang.org> | 2009-06-04 15:28:09 -0700 |
|---|---|---|
| committer | Rob Pike <r@golang.org> | 2009-06-04 15:28:09 -0700 |
| commit | 424f4f0ff5427e9c3149e93abacf00956701e16f (patch) | |
| tree | 10439a4451fcd1f9f6b197f570becb23becce33b /src/lib/bytes/bytes.go | |
| parent | 9a9ffb2b0e03c3a53661b1aa56fc70b0cb910708 (diff) | |
| download | go-424f4f0ff5427e9c3149e93abacf00956701e16f.tar.xz | |
use the new bytes package
R=rsc
DELTA=61 (8 added, 31 deleted, 22 changed)
OCL=29897
CL=29899
Diffstat (limited to 'src/lib/bytes/bytes.go')
| -rw-r--r-- | src/lib/bytes/bytes.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/bytes/bytes.go b/src/lib/bytes/bytes.go index a64b07b74f..dd299a82ee 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). |
