package channel type signal struct{} var def signal type Signal chan signal func NewSingle() Signal { return make(Signal) } func NewBufferSingle(size int) Signal { return make(Signal, size) } func (c Signal) Send() { c <- def } func (c Signal) Read() { <-c }