fix stoponce bug

This commit is contained in:
Alex Grintsvayg 2018-03-28 20:01:44 -04:00
parent bc543a63e1
commit a5d371ca47
No known key found for this signature in database
GPG key ID: AEB3F089F86A22B5

View file

@ -4,13 +4,14 @@ import "sync"
type Stopper struct {
ch chan struct{}
once sync.Once
once *sync.Once
}
func New() *Stopper {
s := Stopper{}
s := &Stopper{}
s.ch = make(chan struct{})
return &s
s.once = &sync.Once{}
return s
}
func (s *Stopper) Chan() <-chan struct{} {