satisfy race detection in Debounce0
@@ -20,14 +20,12 @@ func Debounce0(fn func(), duration time.Duration) (func(), chan<- struct{}) {
case <-stop:
return
case <-timer.C:
- if callRequested {
lock.Lock()
-
+ if callRequested {
fn()
callRequested = false
-
- lock.Unlock()
}
+ lock.Unlock()
}
}
}()
