code: func (s *Store) kvsDeleteCASTxn(tx *memdb.Txn, idx, cidx uint64, key string) (bool, error) {
  	// Retrieve the existing kvs entry, if any exists.
  	entry, err := tx.First("kvs", "id", key)
  	if err != nil {
  		return false, fmt.Errorf("failed kvs lookup: %s", err)
  	}
  
  	// If the existing index does not match the provided CAS
  	// index arg, then we shouldn't update anything and can safely
  	// return early here.
  	e, ok := entry.(*structs.DirEntry)
  	if !ok || e.ModifyIndex != cidx {
  		return entry == nil, nil
  	}
  
  	// Call the actual deletion if the above passed.
  	if err := s.kvsDeleteTxn(tx, idx, key); err != nil {
  		return false, err
  	}
  	return true, nil
  }
docs: // kvsDeleteCASTxn is the inner method that does a CAS delete within an existing
  // transaction.