TLDR; channels, like maps, are references to the a data structure stored 
elsewhere. Calling Len on either returns the length of the data stored in the 
underlying channel. This is different to a slice, which is a three word value, 
containing it's own Len and cap values. 

As Jan notes, Len(ch) is usually not what you want becuase any value returned 
from that expression is considered stale in the presence of multiple 
goroutines. 

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to