You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// ensure sync with the receiver, otherwise clearwatching could be called and exit and the ctx.done be called later on the same goroutine and still arrive before the clearwatching signal
var cancelMu sync.Mutex
go func() {
select {
case <-ch: // release goroutine on clearwatching()
case <-ctx.Done():
cancelMu.Lock()
if cancel != nil { // could be cleared already by clearwatching()