The empty struct struct {}
requires no memory. So if you have a channel with a large capacity you can save a few bytes by switching from make(chan bool, 1<<16)
to make(struct {}, 1<<16)
. Using interface {} requires more space and is really strange here.
For an unbuffered done channel I think using struct {} is wrong as it is unclear. Using a simple chan bool
is much more sensible. Using interface {} is completely wrong: It probably uses more space and is even less clear than struct {}.