Analysis of empty structure channel in soluble golang
Today, I will talk to you about the analysis of the empty structure channel in soluble golang, which may not be well understood by many people. in order to make you understand better, the editor has summarized the following content for you. I hope you can get something according to this article.
Characteristics
Provincial memory, especially when events are communicated.
The zero value of struct is itself. Reading the channel of close returns zero value.
Working with scen
First, event notification can be written to notify other protocols, but only one can be notified.
Channel: = make (chan struct {})
Go func () {
/ /... Do something
Channel