viper-app/pkg/chan.go
2023-02-03 16:18:31 +08:00

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
}