20 lines
267 B
Go
20 lines
267 B
Go
|
package pkg
|
||
|
|
||
|
type signal struct{}
|
||
|
|
||
|
var def signal
|
||
|
|
||
|
type SignalChan chan signal
|
||
|
|
||
|
func NewSingleChan() SignalChan {
|
||
|
return make(chan signal)
|
||
|
}
|
||
|
|
||
|
func NewBufferSingleChan(size int) SignalChan {
|
||
|
return make(chan signal, size)
|
||
|
}
|
||
|
|
||
|
func (c SignalChan) Send() {
|
||
|
c <- def
|
||
|
}
|