Skip to content

Comment on Go version 1 proposal

Comments

I have only skimmed the page, but this caught my eye:

    Close is intended as a way for a sender to signal
    that no more values will be sent.  

    Go 1 will disallow close on receive-only channels.
Why, then, would one still call this 'close'? Wouldn't "done", "dontexpectmore" or "sendEndOfData" be better names?

Yesterday in #go-nuts we were discussing better names for close() which currently causes so much confusion, my suggestion was end(), but done() is a good one too.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.