// Remove deletes the content from the directory for a given id.
975532
func (d *Driver) Remove(id string) error {
	if d.ostreeRepo != "" {
		// Ignore errors, we don't want to fail if the ostree branch doesn't exist,
		ostree.DeleteOSTree(d.ostreeRepo, id)
	}
	return system.EnsureRemoveAll(d.dir(id))
}
264913
func (m *Model) Remove() {
	for _, dir := range m.dirs {
		_ = os.RemoveAll(dir)
	}
}
1341442
func Remove(src string) error {
	appkey, err := registry.OpenKey(syscall.HKEY_LOCAL_MACHINE, addKeyName)
	if err != nil {
		return err
	}
	defer appkey.Close()
	return appkey.DeleteSubKey(src)
}
605223
func (rbac *RBAC) Remove(id string) (err error) {
	rbac.mutex.Lock()
	if _, ok := rbac.roles[id]; ok {
		delete(rbac.roles, id)
		for rid, parents := range rbac.parents {
			if rid == id {
				delete(rbac.parents, rid)
				continue
			}
			for parent := range parents {
				if parent == id {
					delete(rbac.parents[rid], id)
					break
				}
			}
		}
	} else {
		err = ErrRoleNotExist
	}
	rbac.mutex.Unlock()
	return
}
424082
func (c *memoryStore) Delete(id string) {
	c.Lock()
	delete(c.s, id)
	c.Unlock()
}
631313
func (s *DomainsService) Delete(ID int) (*Response, error) {
	path := domainAction("Remove")
	returnedDomain := domainWrapper{}

	payload := newPayLoad(s.client.CommonParams)
	payload.Set("domain_id", strconv.FormatInt(int64(ID), 10))

	res, err := s.client.post(path, payload, &returnedDomain)
	if err != nil {
		return res, err
	}

	return res, nil
}
1170598
func (c *Container) Remove(ctx context.Context) error {
	if c.Engine == nil {
		return ErrNilEngine
	}
	return c.Engine.VirtualizationRemove(ctx, c.ID, true, true)
}
522665
func (r *RepoFile) Remove(name string) bool {
	cp := []*Entry{}
	found := false
	for _, rf := range r.Repositories {
		if rf.Name == name {
			found = true
			continue
		}
		cp = append(cp, rf)
	}
	r.Repositories = cp
	return found
}
264404
func (c *Client) Remove(storageIds []string, destroyAttachments, destroyStorage bool, force *bool, maxWait *time.Duration) ([]params.ErrorResult, error) {
	for _, id := range storageIds {
		if !names.IsValidStorage(id) {
			return nil, errors.NotValidf("storage ID %q", id)
		}
	}
	results := params.ErrorResults{}
	var args interface{}
	var method string
	if c.BestAPIVersion() <= 3 {
		if !destroyStorage {
			return nil, errors.Errorf("this juju controller does not support non-destructive removal of storage")
		}
		// In version 3, destroyAttached is ignored; removing
		// storage always causes detachment.
		entities := make([]params.Entity, len(storageIds))
		for i, id := range storageIds {
			entities[i].Tag = names.NewStorageTag(id).String()
		}
		args = params.Entities{entities}
		method = "Destroy"
	} else {
		aStorage := make([]params.RemoveStorageInstance, len(storageIds))
		for i, id := range storageIds {
			aStorage[i] = params.RemoveStorageInstance{
				Tag:                names.NewStorageTag(id).String(),
				DestroyAttachments: destroyAttachments,
				DestroyStorage:     destroyStorage,
			}
			if c.BestAPIVersion() > 5 {
				aStorage[i].Force = force
				aStorage[i].MaxWait = maxWait
			}
		}
		args = params.RemoveStorage{aStorage}
		method = "Remove"
	}
	if err := c.facade.FacadeCall(method, args, &results); err != nil {
		return nil, errors.Trace(err)
	}
	if len(results.Results) != len(storageIds) {
		return nil, errors.Errorf(
			"expected %d result(s), got %d",
			len(storageIds), len(results.Results),
		)
	}
	return results.Results, nil
}
503930
func (b *Batch) Delete(id string) {
	if id != "" {
		b.internal.Delete(id)
	}
}
1300538
func (s *Session) Remove(key string) error {
	s.Lock()
	defer s.Unlock()

	delete(s.data, key)
	return s.updateEncodedData()
}
937989
func (b *backups) Remove(id string) error {
	return errors.Trace(b.storage.Remove(id))
}
1068902
func (r *Repo) Remove(ctx context.Context, id uuid.UUID) error {
	r.RemoveCalled = true
	if r.SaveErr != nil {
		return r.SaveErr
	}
	r.Entity = nil
	return nil
}
485036
func (s *shard) Remove(key uint32) {
	s.Lock()
	delete(s.items, key)
	s.Unlock()
}
781728
func (f *FakeCommandRunner) Remove(file assets.CopyableFile) error {
	f.fileMap.Delete(file.GetAssetName())
	return nil
}
590263
func (c *Cache) Remove(itmID string) {
	c.Lock()
	c.remove(itmID)
	c.Unlock()
}
685809
func (d *directIndex) Remove() error {
	if d.fd == nil {
		return nil
	}

	// Close the file handle to prevent leaking.  We ignore the error because
	// we just want to cleanup and remove the file.
	_ = d.fd.Close()

	return os.Remove(d.fd.Name())
}