// RemoveTxtRecord remove a TXT record
511727
func (c *Client) RemoveTxtRecord(recordID int, zoneName string) error {
	reqURL := *c.BaseURL
	reqURL.Path += "delete-record.json"

	q := reqURL.Query()
	q.Add("domain-name", zoneName)
	q.Add("record-id", strconv.Itoa(recordID))
	reqURL.RawQuery = q.Encode()

	raw, err := c.doRequest(http.MethodPost, &reqURL)
	if err != nil {
		return err
	}

	resp := apiResponse{}
	if err = json.Unmarshal(raw, &resp); err != nil {
		return fmt.Errorf("apiResponse unmarshaling error: %v: %s", err, string(raw))
	}

	if resp.Status != "Success" {
		return fmt.Errorf("fail to add TXT record: %s %s", resp.Status, resp.StatusDescription)
	}

	return nil
}
420023
func (t *OSesTable) remove(c context.Context) error {
	// Avoid using the database connection to prepare unnecessary statements.
	if len(t.removals) == 0 {
		return nil
	}

	db := database.Get(c)
	stmt, err := db.PrepareContext(c, `
		DELETE FROM oses
		WHERE id = ?
	`)
	if err != nil {
		return errors.Annotate(err, "failed to prepare statement").Err()
	}
	defer stmt.Close()

	// Remove each operating system from the table. It's more efficient to update the slice of
	// operating systems once at the end rather than for each removal, so use a defer.
	removed := make(map[int64]struct{}, len(t.removals))
	defer func() {
		var oses []*OS
		for _, os := range t.current {
			if _, ok := removed[os.Id]; !ok {
				oses = append(oses, os)
			}
		}
		t.current = oses
	}()
	for len(t.removals) > 0 {
		os := t.removals[0]
		if _, err := stmt.ExecContext(c, os.Id); err != nil {
			// Defer ensures the slice of operating systems is updated even if we exit early.
			return errors.Annotate(err, "failed to remove operating system %q", os.Name).Err()
		}
		removed[os.Id] = struct{}{}
		t.removals = t.removals[1:]
		logging.Infof(c, "Removed operating system %q", os.Name)
	}
	return nil
}
773296
func (d *DNSProvider) updateTxtRecord(domain, token, txt string, clear bool) error {
	u, _ := url.Parse("https://www.duckdns.org/update")

	mainDomain := getMainDomain(domain)
	if len(mainDomain) == 0 {
		return fmt.Errorf("unable to find the main domain for: %s", domain)
	}

	query := u.Query()
	query.Set("domains", mainDomain)
	query.Set("token", token)
	query.Set("clear", strconv.FormatBool(clear))
	query.Set("txt", txt)
	u.RawQuery = query.Encode()

	response, err := d.config.HTTPClient.Get(u.String())
	if err != nil {
		return err
	}
	defer response.Body.Close()

	bodyBytes, err := ioutil.ReadAll(response.Body)
	if err != nil {
		return err
	}

	body := string(bodyBytes)
	if body != "OK" {
		return fmt.Errorf("request to change TXT record for DuckDNS returned the following result (%s) this does not match expectation (OK) used url [%s]", body, u)
	}
	return nil
}
1372198
func (s *Store) RemoveIndex(dataType interface{}, indexName string) error {
	storer := newStorer(dataType)
	return s.Bolt().Update(func(tx *bolt.Tx) error {
		return tx.DeleteBucket(indexBucketName(storer.Type(), indexName))

	})
}
873212
func (m *MockArticle) RemoveStaleUnreadRecords() error {
	ret := m.ctrl.Call(m, "RemoveStaleUnreadRecords")
	ret0, _ := ret[0].(error)
	return ret0
}
1169324
func (s *StateStore) RemoveIndex(name string) error {
	txn := s.db.Txn(true)
	defer txn.Abort()

	if _, err := txn.DeleteAll("index", "id", name); err != nil {
		return err
	}

	txn.Commit()
	return nil
}
1335064
func Remove(path, name string) error {
	if err := removexattr(path, name); err != nil {
		return &Error{"xattr.Remove", path, name, err}
	}
	return nil
}
856623
func (r *RegexpList) Remove(val string) {
	tmpData := []string{}
	for _, item := range *r {
		if item == val {
			continue
		}
		tmpData = append(tmpData, item)
	}
	*r = tmpData
	return
}
1125381
func RemoveExistingChain(name string, table Table) error {
	c := &ChainInfo{
		Name:  name,
		Table: table,
	}
	if string(c.Table) == "" {
		c.Table = Filter
	}
	return c.Remove()
}
974440
func (r *RecordList) Remove(ev EventBuilder, fn Listener) int {
	idx, rec := r.Find(ev.Name())
	if idx == -1 {
		return 0
	}

	// 1. Find the index of the listener in the list
	oldList := rec.getUnsafeList()
	spliceIndex := -1
	for i, l := range oldList {
		if l != nil && (*(*Listener)(l)) == fn {
			spliceIndex = i
			break
		}
	}

	if spliceIndex == -1 {
		return len(oldList)
	}

	newCount := len(oldList) - rec.inactiveItems - 1
	// 2. If that's the only listener, just remove that record entirely.
	if newCount == 0 {
		r.remove(idx)
		return 0
	}

	// 3. Otherwise, wipe the pointer, or make a new list copied from the parts
	// of the old if we wanted to compact it.
	if float32(rec.inactiveItems+1)/float32(len(oldList)) < compactionThreshold {
		rec.storeAtIndex(spliceIndex, nil)
		rec.inactiveItems++
		return newCount
	}

	newList := make([]unsafe.Pointer, 0, newCount)
	for i, ptr := range oldList {
		if ptr != nil && i != spliceIndex {
			newList = append(newList, ptr)
		}
	}
	rec.inactiveItems = 0
	rec.setList(newList)

	return newCount
}
1331557
func (mr *MockArticleMockRecorder) RemoveStaleUnreadRecords() *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveStaleUnreadRecords", reflect.TypeOf((*MockArticle)(nil).RemoveStaleUnreadRecords))
}
236607
func (c *FormatCheckerChain) Remove(name string) *FormatCheckerChain {
	lock.Lock()
	delete(c.formatters, name)
	lock.Unlock()

	return c
}
138640
func removeExt(fileName string) string {
	ext := filepath.Ext(fileName)
	return fileName[0 : len(fileName)-len(ext)]
}
14414
func (linux *systemDRecord) Remove() (string, error) {
	removeAction := "Removing " + linux.description + ":"

	if ok, err := checkPrivileges(); !ok {
		return removeAction + failed, err
	}

	if !linux.isInstalled() {
		return removeAction + failed, ErrNotInstalled
	}

	if err := exec.Command("systemctl", "disable", linux.name+".service").Run(); err != nil {
		return removeAction + failed, err
	}

	if err := os.Remove(linux.servicePath()); err != nil {
		return removeAction + failed, err
	}

	return removeAction + success, nil
}
604890
func (s *SessionVars) RemovePreparedStmt(stmtID uint32) {
	_, exists := s.PreparedStmts[stmtID]
	if !exists {
		return
	}
	delete(s.PreparedStmts, stmtID)
	afterMinus := atomic.AddInt64(&preparedStmtCount, -1)
	metrics.PreparedStmtGauge.Set(float64(afterMinus))
}
111449
func (idx *AddrIndex) RemoveUnconfirmedTx(hash *chainhash.Hash) {
	idx.unconfirmedLock.Lock()
	defer idx.unconfirmedLock.Unlock()

	// Remove all address references to the transaction from the address
	// index and remove the entry for the address altogether if it no longer
	// references any transactions.
	for addrKey := range idx.addrsByTx[*hash] {
		delete(idx.txnsByAddr[addrKey], *hash)
		if len(idx.txnsByAddr[addrKey]) == 0 {
			delete(idx.txnsByAddr, addrKey)
		}
	}

	// Remove the entry from the transaction to address lookup map as well.
	delete(idx.addrsByTx, *hash)
}
465012
func (windows *windowsRecord) Remove() (string, error) {
	removeAction := "Removing " + windows.description + ":"

	m, err := mgr.Connect()
	if err != nil {
		return removeAction + failed, getWindowsError(err)
	}
	defer m.Disconnect()
	s, err := m.OpenService(windows.name)
	if err != nil {
		return removeAction + failed, getWindowsError(err)
	}
	defer s.Close()
	err = s.Delete()
	if err != nil {
		return removeAction + failed, getWindowsError(err)
	}

	return removeAction + " completed.", nil
}