mirror of
https://github.com/golang/go
synced 2024-11-26 18:16:48 -07:00
io: make CopyBuffer docs state when buf is not used
Document that if either src implements the WriteTo interface or if dst implements the ReaderFrom interface, then buf will not be used. Fixes #32276
This commit is contained in:
parent
1b541b4bf2
commit
750e7e86d5
@ -369,7 +369,7 @@ func Copy(dst Writer, src Reader) (written int64, err error) {
|
||||
// temporary one. If buf is nil, one is allocated; otherwise if it has
|
||||
// zero length, CopyBuffer panics.
|
||||
//
|
||||
// If either src implements WriterTo or if dst implements ReaderFrom,
|
||||
// If either src implements WriterTo or dst implements ReaderFrom,
|
||||
// buf will not be used to perform the copy.
|
||||
func CopyBuffer(dst Writer, src Reader, buf []byte) (written int64, err error) {
|
||||
if buf != nil && len(buf) == 0 {
|
||||
|
Loading…
Reference in New Issue
Block a user