code: func (s *Store) deleteCheckCASTxn(tx *memdb.Txn, idx, cidx uint64, node string, checkID types.CheckID) (bool, error) {
  	// Try to retrieve the existing health check.
  	_, hc, err := s.getNodeCheckTxn(tx, node, checkID)
  	if err != nil {
  		return false, fmt.Errorf("check lookup failed: %s", err)
  	}
  	if hc == nil {
  		return false, nil
  	}
  
  	// If the existing index does not match the provided CAS
  	// index arg, then we shouldn't update anything and can safely
  	// return early here.
  	if hc.ModifyIndex != cidx {
  		return false, nil
  	}
  
  	// Call the actual deletion if the above passed.
  	if err := s.deleteCheckTxn(tx, idx, node, checkID); err != nil {
  		return false, err
  	}
  
  	return true, nil
  }
docs: // deleteCheckCASTxn is used to try doing a check delete operation with a given
  // raft index. If the CAS index specified is not equal to the last observed index for
  // the given check, then the call is a noop, otherwise a normal check delete is invoked.