[go-nuts] Re: Closed channel vs nil channel when writing

2019-09-03 Thread clement auger
sorry i can t find the added value i m looking for within those two publications. thanks for trying to help, it will be good pointers for future readers starting to learn go and reading those words. Le lundi 2 septembre 2019 19:12:03 UTC+2, Jake Montgomery a écrit : > > > On Monday, September

[go-nuts] Re: Closed channel vs nil channel when writing

2019-09-03 Thread clement auger
The compiler will produce the same result using an uninitialized channel variable (ie nil chan); btw, the spec admits that a "nil channel" is a valid concept, several references can be found within it. You might as well quote the specification rather than rephrasing, it is way shorter and effic

[go-nuts] Re: Closed channel vs nil channel when writing

2019-09-02 Thread Jake Montgomery
On Monday, September 2, 2019 at 9:41:54 AM UTC-4, T L wrote: > > https://go101.org/article/channel.html > That is a great, and pretty detailed article. For quick reference I like https://dave.cheney.net/2014/03/19/channel-axioms . -- You received this message because you are subscribed to the

[go-nuts] Re: Closed channel vs nil channel when writing

2019-09-02 Thread T L
On Sunday, September 1, 2019 at 12:03:58 PM UTC-4, clement auger wrote: > > hi, > > I am looking for further details and explanations about the various > behaviors > associated with closed Vs nil channels. > > I already read > https://stackoverflow.com/questions/43616434/closed-channel-vs-nil-c

[go-nuts] Re: Closed channel vs nil channel when writing

2019-09-01 Thread Albert Tedja
No such thing as a 'nil channel'. You are merely setting a variable to nil, regardless what the previous content is. It's just that Go allows you to receive from a nil variable if that variable's type is a channel, in which case it blocks forever. On Sunday, September 1, 2019 at 9:03:58 AM UT