Remove done
channel in client-server echo example
#896
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What type of PR is this? (check all applicable)
Description
I don't believe anything is actually sent to the
done
channel, in this example there are only statements reading from it. Furthermore, the deferredclose(done)
statement will never execute because deferred statements in other goroutines are not run when main terminates. So no messages will ever be sent to this channel and it will never be closed, so it is safe to remove all the references todone
.I took a look at 844dd6d , where
done
was introduced, and the situation was similar then, so I believe this is an oversight in that commit.Related Tickets & Documents
None
Added/updated tests?
Run verifications and test
make verify
is passingmake test
is passingI didn't run these ^ .