code: func (l *Lock) Destroy() error {
  	// Hold the lock as we try to release
  	l.l.Lock()
  	defer l.l.Unlock()
  
  	// Check if we already hold the lock
  	if l.isHeld {
  		return ErrLockHeld
  	}
  
  	// Look for an existing lock
  	kv := l.c.KV()
  	pair, _, err := kv.Get(l.opts.Key, nil)
  	if err != nil {
  		return fmt.Errorf("failed to read lock: %v", err)
  	}
  
  	// Nothing to do if the lock does not exist
  	if pair == nil {
  		return nil
  	}
  
  	// Check for possible flag conflict
  	if pair.Flags != LockFlagValue {
  		return ErrLockConflict
  	}
  
  	// Check if it is in use
  	if pair.Session != "" {
  		return ErrLockInUse
  	}
  
  	// Attempt the delete
  	didRemove, _, err := kv.DeleteCAS(pair, nil)
  	if err != nil {
  		return fmt.Errorf("failed to remove lock: %v", err)
  	}
  	if !didRemove {
  		return ErrLockInUse
  	}
  	return nil
  }
docs: // Destroy is used to cleanup the lock entry. It is not necessary
  // to invoke. It will fail if the lock is in use.