(no title)
tczMUFlmoNk | 4 months ago
If you have a buffered channel with 100 "struct{}{}"s in it, you only need to store the length, since the element type is zero-sized.
tczMUFlmoNk | 4 months ago
If you have a buffered channel with 100 "struct{}{}"s in it, you only need to store the length, since the element type is zero-sized.
Someone|4 months ago
tczMUFlmoNk|4 months ago
I am not sure how much this improves code readability in practice—I see chan struct{} frequently, but I cannot recall ever having seen chan T for a zero-sized T other than struct{}.