Skip to content
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: unify EOF documentation for ReadFrom and WriteTo #44475

Closed

Conversation

cyphar
Copy link

@cyphar cyphar commented Feb 21, 2021

Because io.Copy delegates to WriteTo and ReadFrom if possible,
implementors need to be made aware that the EOF behaviour of WriteTo and
ReadFrom need to match the io.Copy semantics (do not return io.EOF --
even if no bytes are read).

In addition, the documentation of the two interfaces had diverged
slightly, so re-unify the wording.

Fixes #44411

@google-cla google-cla bot added the cla: yes Used by googlebot to label PRs as having a valid CLA. The text of this label should not change. label Feb 21, 2021
@gopherbot
Copy link
Contributor

This PR (HEAD: d3c1c31) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/294769 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Ian Lance Taylor:

Patch Set 1:

(3 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/294769.
After addressing review feedback, remember to publish your drafts!

@cyphar cyphar force-pushed the issue44411-writerto-documentation branch from d3c1c31 to 19af36b Compare February 22, 2021 04:19
@gopherbot
Copy link
Contributor

This PR (HEAD: 19af36b) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/294769 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Aleksa Sarai:

Patch Set 1:

(3 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/294769.
After addressing review feedback, remember to publish your drafts!

Because io.Copy delegates to WriteTo and ReadFrom if possible,
implementors need to be made aware that the EOF behaviour of WriteTo and
ReadFrom need to match the io.Copy semantics (do not return io.EOF --
even if no bytes are read).

In addition, the documentation of the two interfaces had diverged
slightly, so re-unify the wording.

Fixes golang#44411
@cyphar cyphar force-pushed the issue44411-writerto-documentation branch from 19af36b to 32dd90e Compare February 22, 2021 04:23
@gopherbot
Copy link
Contributor

This PR (HEAD: 32dd90e) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/294769 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Aleksa Sarai:

Patch Set 4:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/294769.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Russ Cox:

Patch Set 4: Code-Review-2

(3 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/294769.
After addressing review feedback, remember to publish your drafts!

@cyphar cyphar closed this May 20, 2021
@cyphar cyphar deleted the issue44411-writerto-documentation branch May 20, 2021 04:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Used by googlebot to label PRs as having a valid CLA. The text of this label should not change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

io: Copy implicilty requires WriterTo and ReaderFrom to not return io.EOF
2 participants