fix stoponce bug
This commit is contained in:
parent
bc543a63e1
commit
a5d371ca47
1 changed files with 4 additions and 3 deletions
|
@ -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{} {
|
||||
|
|
Loading…
Add table
Reference in a new issue