prow/github/fakegithub/fakegithub.go
func (f *FakeClient) DeleteProjectCard(projectCardID int) error {
	if f.ColumnCardsMap == nil {
		return fmt.Errorf("Project card doesn't exist")
	}
	f.Project = ""
	f.Column = ""
	newCards := []github.ProjectCard{}
	oldColumnID := -1
	for column, cards := range f.ColumnCardsMap {
		removalIndex := -1
		for i, existingCard := range cards {
			if existingCard.ContentID == projectCardID {
				oldColumnID = column
				removalIndex = i
				break
			}
		}
		if removalIndex != -1 {
			newCards = cards
			newCards[removalIndex] = newCards[len(newCards)-1]
			newCards = newCards[:len(newCards)-1]
			break
		}
	}
	// Update the old column's list of project cards
	if oldColumnID != -1 {
		f.ColumnCardsMap[oldColumnID] = newCards
	}
	return nil
}
func (f *FakeClient) DeleteProjectCard(projectCardID int) error {
	if f.ColumnCardsMap == nil {
		return fmt.Errorf("Project card doesn't exist")
	}
	f.Project = ""
	f.Column = ""
	newCards := []github.ProjectCard{}
	oldColumnID := -1
	for column, cards := range f.ColumnCardsMap {
		removalIndex := -1
		for i, existingCard := range cards {
			if existingCard.ContentID == projectCardID {
				oldColumnID = column
				removalIndex = i
				break
			}
		}
		if removalIndex != -1 {
			newCards = cards
			newCards[removalIndex] = newCards[len(newCards)-1]
			newCards = newCards[:len(newCards)-1]
			break
		}
	}
	// Update the old column's list of project cards
	if oldColumnID != -1 {
		f.ColumnCardsMap[oldColumnID] = newCards
	}
	return nil
}
func ( f * FakeClient ) DeleteProjectCard ( projectCardID int ) error { if f . ColumnCardsMap == nil { return fmt . Errorf ( " " ) } f . Project = " " f . Column = " " newCards := [ ] github . ProjectCard { } oldColumnID := - 1 for column , cards := range f . ColumnCardsMap { removalIndex := - 1 for i , existingCard := range cards { if existingCard . ContentID == projectCardID { oldColumnID = column removalIndex = i break } } if removalIndex != - 1 { newCards = cards newCards [ removalIndex ] = newCards [ len ( newCards ) - 1 ] newCards = newCards [ : len ( newCards ) - 1 ] break } } // Update the old column's list of project cards if oldColumnID != - 1 { f . ColumnCardsMap [ oldColumnID ] = newCards } return nil }
// DeleteProjectCard deletes the project card of a specific issue or PR
DeleteProjectCard deletes the project card of a specific issue or PR