// Remove removes the CloudFormation stack for the given app, if it exists.
328185
func (s *Scheduler) remove(_ context.Context, tx *sql.Tx, appID string) error {
	stackName, err := s.stackName(appID)

	// if there's no stack entry in the db for this app, nothing to remove
	if err == errNoStack {
		return nil
	}
	if err != nil {
		return err
	}

	_, err = tx.Exec(`DELETE FROM stacks WHERE app_id = $1`, appID)
	if err != nil {
		return err
	}

	_, err = s.cloudformation.DescribeStacks(&cloudformation.DescribeStacksInput{
		StackName: aws.String(stackName),
	})
	if err, ok := err.(awserr.Error); ok && err.Message() == fmt.Sprintf("Stack with id %s does not exist", stackName) {
		return nil
	}

	if _, err := s.cloudformation.DeleteStack(&cloudformation.DeleteStackInput{
		StackName: aws.String(stackName),
	}); err != nil {
		return fmt.Errorf("error deleting stack: %v", err)
	}

	return nil
}
629766
func (c *Client) Remove(name string) error {
	return delete(c, name, false)
}
264913
func (m *Model) Remove() {
	for _, dir := range m.dirs {
		_ = os.RemoveAll(dir)
	}
}
839301
func (s *stack) Remove() interface{} {
	if s.length == 0 {
		panic("underflow")
	}
	s.length--
	item := s.data[s.length]
	s.data[s.length] = nil
	return item
}
1205034
func (stor *maas2Storage) Remove(name string) error {
	name = stor.prefixWithPrivateNamespace(name)
	file, err := stor.maasController.GetFile(name)
	if err != nil {
		return errors.Trace(err)
	}
	return file.Delete()
}
1300538
func (s *Session) Remove(key string) error {
	s.Lock()
	defer s.Unlock()

	delete(s.data, key)
	return s.updateEncodedData()
}
471874
func (d *StateDir) Remove() error {
	if err := os.Remove(d.path); err != nil && !os.IsNotExist(err) {
		return err
	}
	// If atomic delete succeeded, update own state.
	d.state.Members = nil
	return nil
}
127520
func (rs *RenderSystem) Remove(basic ecs.BasicEntity) {
	var d = rs.EntityExists(&basic)
	if d >= 0 {
		rs.entities = append(rs.entities[:d], rs.entities[d+1:]...)
		rs.sortingNeeded = true
	}
	delete(rs.ids, basic.ID())
}
497851
func (c *Container) remove(v uint16) (removed bool) {
	if c.isArray() {
		removed = c.arrayRemove(v)
	} else if c.isRun() {
		removed = c.runRemove(v)
	} else {
		removed = c.bitmapRemove(v)
	}
	return removed
}
682854
func (s *nodeStack) remove(n *Node) {
	i := s.index(n)
	if i == -1 {
		return
	}
	copy((*s)[i:], (*s)[i+1:])
	j := len(*s) - 1
	(*s)[j] = nil
	*s = (*s)[:j]
}
1001838
func (l *Lambda) remove(kind, name string, m map[string]interface{}) {
	l.log(kind, name, m, '-', red)
}
452355
func (b *InnerJSONBuilder) Remove(infos ...*InnerPropertyInfo) *InnerJSONBuilder {
	for _, info := range infos {
		delete(b._properties, info.fieldName)
	}
	return b
}
584995
func (bsd *bsdRecord) Remove() (string, error) {
	removeAction := "Removing " + bsd.description + ":"

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

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

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

	return removeAction + success, nil
}
1260368
func (s *podSet) Remove(pod *v1.Pod) {
	s.mutex.Lock()
	defer s.mutex.Unlock()
	delete(s.set, podId(pod))
}
467597
func (c *Cache) Remove(u interface{}) (err error) {

	return c.removeNotify(u, false)
}
16509
func (b *HogeJSONBuilder) Remove(info *HogePropertyInfo) *HogeJSONBuilder {
	delete(b._properties, info.fieldName)
	return b
}
772625
func (c *Container) Remove(ctx context.Context, removeVolume bool) error {
	return c.client.ContainerRemove(ctx, c.container.ID, types.ContainerRemoveOptions{
		Force:         true,
		RemoveVolumes: removeVolume,
	})
}