diff --git a/api/lock.go b/api/lock.go index 837304d5ff..83f7b2ca5c 100644 --- a/api/lock.go +++ b/api/lock.go @@ -103,7 +103,7 @@ func (c *Client) LockOpts(opts *LockOptions) (*Lock, error) { // created without any associated health checks. By default Consul sessions // prefer liveness over safety and an application must be able to handle // the lock being lost. -func (l *Lock) Lock(stopCh chan struct{}) (chan struct{}, error) { +func (l *Lock) Lock(stopCh <-chan struct{}) (<-chan struct{}, error) { // Hold the lock as we try to acquire l.l.Lock() defer l.l.Unlock() diff --git a/api/semaphore.go b/api/semaphore.go index 17b6396c34..f62af92f3c 100644 --- a/api/semaphore.go +++ b/api/semaphore.go @@ -128,7 +128,7 @@ func (c *Client) SemaphoreOpts(opts *SemaphoreOptions) (*Semaphore, error) { // created without any associated health checks. By default Consul sessions // prefer liveness over safety and an application must be able to handle // the session being lost. -func (s *Semaphore) Acquire(stopCh chan struct{}) (chan struct{}, error) { +func (s *Semaphore) Acquire(stopCh <-chan struct{}) (<-chan struct{}, error) { // Hold the lock as we try to acquire s.l.Lock() defer s.l.Unlock()