Fix EventSwitch usage in WaitForOneEvent
This commit is contained in:
parent
d56cb2ab4b
commit
21501815dd
|
@ -72,9 +72,8 @@ func WaitForOneEvent(evsw types.EventSwitch,
|
||||||
evts <- data
|
evts <- data
|
||||||
})
|
})
|
||||||
// make sure to unregister after the test is over
|
// make sure to unregister after the test is over
|
||||||
// TODO: why doesn't the other call work???
|
defer evsw.RemoveListenerForEvent(evtTyp, listener)
|
||||||
// defer evsw.RemoveListenerForEvent(listener, evtTyp)
|
// defer evsw.RemoveListener(listener) // this also works
|
||||||
defer evsw.RemoveListener(listener)
|
|
||||||
|
|
||||||
select {
|
select {
|
||||||
case <-quit:
|
case <-quit:
|
||||||
|
|
Loading…
Reference in New Issue