diff options
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 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). |