Open debedb opened 7 years ago
Lock() of Locker interface should probably take a receive-only channel for stopChan, that is, instead of
Lock(stopChan chan struct{}) (<-chan struct{}, error)
have
Lock(<-stopChan chan struct{}) (<-chan struct{}, error)
Lock would not be writing to stopChan, the user of the Lock will - and this signature will allow using things like Context's Done channel directly (without mediating it with another select).
Lock() of Locker interface should probably take a receive-only channel for stopChan, that is, instead of
Lock(stopChan chan struct{}) (<-chan struct{}, error)
have
Lock(<-stopChan chan struct{}) (<-chan struct{}, error)
Lock would not be writing to stopChan, the user of the Lock will - and this signature will allow using things like Context's Done channel directly (without mediating it with another select).