New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
io: CopyBuffer should document when buf is not used #32276
Labels
Documentation
FrozenDueToAge
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
Comments
This was referenced May 28, 2019
bcmills
added
Documentation
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
labels
May 28, 2019
This closely relates to #16474. |
bcmills
added
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
and removed
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
labels
May 29, 2019
odeke-em
changed the title
io: CopyBuffer comment should be more precise
io: CopyBuffer should document when buf is not used
Oct 15, 2019
sandyskies
added a commit
to sandyskies/go
that referenced
this issue
Oct 20, 2019
Document that if either src implements the WriteTo interface or if dst implements the ReaderFrom interface, then buf will not be used. Fixes golang#32276
sandyskies
added a commit
to sandyskies/go
that referenced
this issue
Oct 21, 2019
Document that if either src implements the WriteTo interface or if dst implements the ReaderFrom interface, then buf will not be used. Fixes golang#32276
Change https://golang.org/cl/179137 mentions this issue: |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
Documentation
FrozenDueToAge
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
The follow is the comment for io.CopyBuffer,
// CopyBuffer is identical to Copy except that it stages through the
// provided buffer (if one is required) rather than allocating a
// temporary one. If buf is nil, one is allocated; otherwise if it has
// zero length, CopyBuffer panics.
func CopyBuffer(dst Writer, src Reader, buf []byte) (written int64, err error)
which is not precise enough, in the case of src implements the WriterTo interface or the case of if dst implements the ReaderFrom interface , buf will be ignore ,which is not mentioned at all. Which is very easy to lead people to wrong way.
The text was updated successfully, but these errors were encountered: