mirror of
https://github.com/golang/go
synced 2024-11-24 22:00:09 -07:00
spec: fix copy to return "number of elements copied", not "number
of arguments copied". R=gri, r CC=golang-dev https://golang.org/cl/4550041
This commit is contained in:
parent
77d66f4131
commit
703b092779
@ -1,5 +1,5 @@
|
|||||||
<!-- title The Go Programming Language Specification -->
|
<!-- title The Go Programming Language Specification -->
|
||||||
<!-- subtitle Version of May 13, 2011 -->
|
<!-- subtitle Version of May 15, 2011 -->
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
TODO
|
TODO
|
||||||
@ -4611,7 +4611,7 @@ a source <code>src</code> to a destination <code>dst</code> and returns the
|
|||||||
number of elements copied. Source and destination may overlap.
|
number of elements copied. Source and destination may overlap.
|
||||||
Both arguments must have <a href="#Type_identity">identical</a> element type <code>T</code> and must be
|
Both arguments must have <a href="#Type_identity">identical</a> element type <code>T</code> and must be
|
||||||
<a href="#Assignability">assignable</a> to a slice of type <code>[]T</code>.
|
<a href="#Assignability">assignable</a> to a slice of type <code>[]T</code>.
|
||||||
The number of arguments copied is the minimum of
|
The number of elements copied is the minimum of
|
||||||
<code>len(src)</code> and <code>len(dst)</code>.
|
<code>len(src)</code> and <code>len(dst)</code>.
|
||||||
As a special case, <code>copy</code> also accepts a destination argument assignable
|
As a special case, <code>copy</code> also accepts a destination argument assignable
|
||||||
to type <code>[]byte</code> with a source argument of a string type.
|
to type <code>[]byte</code> with a source argument of a string type.
|
||||||
|
Loading…
Reference in New Issue
Block a user