mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
bytes.Copy
R=rsc DELTA=38 (38 added, 0 deleted, 0 changed) OCL=29895 CL=29895
This commit is contained in:
parent
78933226f1
commit
52e5d061c7
4 changed files with 38 additions and 0 deletions
|
|
@ -41,6 +41,15 @@ func Equal(a, b []byte) bool {
|
|||
return true
|
||||
}
|
||||
|
||||
// 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) {
|
||||
for i, x := range src {
|
||||
dst[i] = x
|
||||
}
|
||||
}
|
||||
|
||||
// Explode splits s into an array of UTF-8 sequences, one per Unicode character (still arrays of bytes).
|
||||
// Invalid UTF-8 sequences become correct encodings of U+FFF8.
|
||||
func Explode(s []byte) [][]byte {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue