6 ms·
Using chan struct{} is more efficient, and guarantees there is nothing being put into the channel. That's why you see it used on the Context type's Done method,
by zeeboo 7y ago
Using chan struct{} is more efficient, and guarantees there is nothing being put into the channel. That's why you see it used on the Context type's Done method, for example.
https://golang.org/pkg/context/#Context https://golang.org/pkg/context/#Context