builtin: description of close behavior of reading from closed channel is vague #53041
Labels
Documentation
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
What is the URL of the page with the issue?
https://pkg.go.dev/builtin#close
The documentation of the built in close function states explicitly:
This comes after the sentence that states after every item has been read from the channel, but it does not seem clear to me that applies to this statement as well.
When reading from a closed channel that has unread elements in it. It seems intuitive that the behavior that currently exists should be the actual behavior of the language ie. reading from the channel should read all of the available elements, but the documentation currently suggests that is not the case and should be amended.
Wrote a small unit test:
It seems that this was always the intention of the language to work this way, so this issue is just to ask that the documentation be made a little more clear for the close function.
The text was updated successfully, but these errors were encountered: