// DeleteTag deletes a tag from the GitHub API
16177
func (c *GitHubClient) DeleteTag(ctx context.Context, tag string) error {
	ref := fmt.Sprintf("tags/%s", tag)
	res, err := c.Git.DeleteRef(context.TODO(), c.Owner, c.Repo, ref)
	if err != nil {
		return errors.Wrapf(err, "failed to delete tag: %s", ref)
	}

	if res.StatusCode != http.StatusNoContent {
		return errors.Errorf("delete tag: invalid status: %s", res.Status)
	}

	return nil
}
1303715
func (a *api) RemoveSnapshotTag(serviceID string, tagName string) (string, error) {
	client, err := a.connectDAO()
	if err != nil {
		return "", err
	}

	req := dao.SnapshotByTagRequest{
		ServiceID: serviceID,
		TagName:   tagName,
	}
	var snapshotID string
	if err := client.RemoveSnapshotTag(req, &snapshotID); err != nil {
		return "", err
	}

	return snapshotID, nil
}
1093145
func (a *Tags) Delete(key []byte) {
	for i, t := range *a {
		if bytes.Equal(t.Key, key) {
			copy((*a)[i:], (*a)[i+1:])
			(*a)[len(*a)-1] = Tag{}
			*a = (*a)[:len(*a)-1]
			return
		}
	}
}
189590
func (f *LogFile) DeleteTagKey(name, key []byte) error {
	f.mu.Lock()
	defer f.mu.Unlock()

	e := LogEntry{Flag: LogEntryTagKeyTombstoneFlag, Name: name, Key: key}
	if err := f.appendEntry(&e); err != nil {
		return err
	}
	f.execEntry(&e)

	// Flush buffer and sync to disk.
	return f.FlushAndSync()
}
267825
func (c *SearchCall) Tag(tag ...string) *SearchCall {
	c.urlParams_.SetMulti("tag", append([]string{}, tag...))
	return c
}
568342
func (tag *Tag) Close() error {
	file, ok := tag.reader.(*os.File)
	if !ok {
		return ErrNoFile
	}
	return file.Close()
}
509637
func (e Error) Tag(tag Error) Error {
	return Error(string(tag) + ":" + string(e))
}
263106
func (c *aliCloudImplementation) RemoveTags(resourceId string, resourceType string, tags map[string]string) error {
	if len(tags) == 0 {
		return nil
	}
	if resourceId == "" {
		return errors.New("resourceId not provided to RemoveTags")
	}
	if resourceType == "" {
		return errors.New("resourceType not provided to RemoveTags")
	}

	request := &ecs.RemoveTagsArgs{
		ResourceId:   resourceId,
		ResourceType: ecs.TagResourceType(resourceType), //image, instance, snapshot or disk
		RegionId:     common.Region(c.Region()),
		Tag:          tags,
	}
	err := c.EcsClient().RemoveTags(request)
	if err != nil {
		return fmt.Errorf("error removing tags on %v: %v", resourceId, err)
	}

	return nil
}
653016
func (logger *Logger) ClearTag() {
	goID := logger.curGoroutineID()
	logger.tagMap.Delete(goID)
}
5180
func (m *MockMutaterMachine) Tag() names_v2.MachineTag {
	ret := m.ctrl.Call(m, "Tag")
	ret0, _ := ret[0].(names_v2.MachineTag)
	return ret0
}
652570
func (mp *TxPool) RemoveOrphansByTag(tag Tag) uint64 {
	var numEvicted uint64
	mp.mtx.Lock()
	for _, otx := range mp.orphans {
		if otx.tag == tag {
			mp.removeOrphan(otx.tx, true)
			numEvicted++
		}
	}
	mp.mtx.Unlock()
	return numEvicted
}
939692
func (m *MockConfig) Tag() names_v2.Tag {
	ret := m.ctrl.Call(m, "Tag")
	ret0, _ := ret[0].(names_v2.Tag)
	return ret0
}
642870
func (f *FieldSetType) AddTag(tag string) *FieldSetType {
	f.tags[tag] = struct{}{}
	return f
}
655981
func (b *block) Tag() (names.Tag, error) {
	tag, err := names.ParseTag(b.doc.Tag)
	if err != nil {
		return nil, errors.Annotatef(err, "getting block information")
	}
	return tag, nil
}
1251466
func JavascriptTag(opts Options) *Tag {
	if opts["src"] != nil {
		delete(opts, "body")
	}

	return New("script", opts)
}
521808
func (c *Client) ModelTag() (names.ModelTag, bool) {
	return c.facade.RawAPICaller().ModelTag()
}
745018
func (t *Tags) Remove(tag string) error {
	ts := *t
	i := sort.SearchStrings(ts, tag)
	if i < len(ts) && ts[i] == tag {
		if i+1 == len(ts) {
			ts = ts[:i]
		} else {
			ts = append(ts[:i], ts[i+1:]...)
		}
		*t = ts
		return nil
	}
	return e.New(ErrTagNotFound)
}