// Tags applies the function fn to each of the tag-value pairs of the Program.
// The function fn must not add or delete tags held by the receiver during
// iteration.
518191
func (p *Program) Tags(fn func(t Tag, value string)) {
	if fn == nil {
		return
	}
	fn(idTag, p.UID())
	if p.name != "" {
		fn(programNameTag, p.name)
	}
	if p.command != "" {
		fn(commandLineTag, p.command)
	}
	if p.previous != "" {
		fn(previousProgTag, p.previous)
	}
	if p.version != "" {
		fn(versionTag, p.version)
	}
	for _, tp := range p.otherTags {
		fn(tp.tag, tp.value)
	}
}
168217
func (packet *Packet) AddTags(tags map[string]string) {
	for k, v := range tags {
		packet.Tags = append(packet.Tags, Tag{k, v})
	}
}
53542
func (d *Dataset) Tags(index int) ([]string, error) {
	if index < 0 || index >= d.rows {
		return nil, ErrInvalidRowIndex
	}

	return d.tags[index], nil
}
1212133
func (writer *ConsoleWriter) Tags() map[string]string {
	writer.lock.RLock()
	defer writer.lock.RUnlock()

	return writer.blog.Tags()
}
130352
func (r *Route) Tag(value interface{}) *Route {
	if len(r.routes) > 0 {
		// this route is a composite one (a path with multiple methods)
		for _, route := range r.routes {
			route.Tag(value)
		}
		return r
	}
	if r.tags == nil {
		r.tags = []interface{}{}
	}
	r.tags = append(r.tags, value)
	return r
}
1221149
func (g *Group) Tag(items map[string]string) *Statement {
	// notest
	// don't think this can ever be used in valid code?
	s := Tag(items)
	g.items = append(g.items, s)
	return s
}
988371
func WithTags(tags []string) Option {
	return func(o *Options) error {
		o.Tags = tags
		return nil
	}
}
260781
func (t *tags) All(ctx context.Context) ([]string, error) {
	var tags []string

	listURLStr, err := t.ub.BuildTagsURL(t.name)
	if err != nil {
		return tags, err
	}

	listURL, err := url.Parse(listURLStr)
	if err != nil {
		return tags, err
	}

	for {
		resp, err := t.client.Get(listURL.String())
		if err != nil {
			return tags, err
		}
		defer resp.Body.Close()

		if SuccessStatus(resp.StatusCode) {
			b, err := ioutil.ReadAll(resp.Body)
			if err != nil {
				return tags, err
			}

			tagsResponse := struct {
				Tags []string `json:"tags"`
			}{}
			if err := json.Unmarshal(b, &tagsResponse); err != nil {
				return tags, err
			}
			tags = append(tags, tagsResponse.Tags...)
			if link := resp.Header.Get("Link"); link != "" {
				linkURLStr := strings.Trim(strings.Split(link, ";")[0], "<>")
				linkURL, err := url.Parse(linkURLStr)
				if err != nil {
					return tags, err
				}

				listURL = listURL.ResolveReference(linkURL)
			} else {
				return tags, nil
			}
		} else {
			return tags, HandleErrorResponse(resp)
		}
	}
}
959876
func (blog *BLog) Tags() map[string]string {
	blog.lock.RLock()
	defer blog.lock.RUnlock()
	return blog.tags
}
672523
func (xs *xstats) AddTags(tags ...string) {
	if xs.tags == nil {
		xs.tags = tags
	} else {
		xs.tags = append(xs.tags, tags...)
	}
}
497731
func Tags(argv []string) error {
	usage := `
Valid commands for tags:

tags:list        list tags for an app
tags:set         set tags for an app
tags:unset       unset tags for an app

Use 'deis help [command]' to learn more.
`

	switch argv[0] {
	case "tags:list":
		return tagsList(argv)
	case "tags:set":
		return tagsSet(argv)
	case "tags:unset":
		return tagsUnset(argv)
	default:
		if printHelp(argv, usage) {
			return nil
		}

		if argv[0] == "tags" {
			argv[0] = "tags:list"
			return tagsList(argv)
		}

		PrintUsage()
		return nil
	}
}
1191105
func (c *Client) ListTags(p *ListTagsParameter) ([]*Tag, error) {
	obj, err := c.Request("listTags", convertParamToMap(p))
	if err != nil {
		return nil, err
	}
	return obj.([]*Tag), err
}
422383
func (r *ReadGroup) Tags(fn func(t Tag, value string)) {
	if fn == nil {
		return
	}
	fn(idTag, r.name)
	if r.center != "" {
		fn(centerTag, r.center)
	}
	if r.description != "" {
		fn(descriptionTag, r.description)
	}
	if !r.date.IsZero() {
		fn(dateTag, r.date.Format(iso8601TimeDateN))
	}
	if r.flowOrder != "" {
		fn(flowOrderTag, r.flowOrder)
	}
	if r.keySeq != "" {
		fn(keySequenceTag, r.keySeq)
	}
	if r.library != "" {
		fn(libraryTag, r.library)
	}
	if r.program != "" {
		fn(programTag, r.program)
	}
	if r.insertSize != 0 {
		fn(insertSizeTag, fmt.Sprint(r.insertSize))
	}
	if r.platform != "" {
		fn(platformTag, r.platform)
	}
	if r.platformUnit != "" {
		fn(platformUnitTag, r.platformUnit)
	}
	if r.sample != "" {
		fn(sampleTag, r.sample)
	}
	for _, tp := range r.otherTags {
		fn(tp.tag, tp.value)
	}
}
1203655
func Tags(tags map[string]string) TracerOption {
	return func(o *tracerOptions) {
		for k, v := range tags {
			o.tags[k] = v
		}
	}
}
224654
func (s *stat) Tags() map[string]string {
	m := make(map[string]string, len(s.tags))
	for k, v := range s.tags {
		m[k] = v
	}
	return m
}
251865
func tagsFromMapEFS(m map[string]interface{}) []*efs.Tag {
	var result []*efs.Tag
	for k, v := range m {
		t := &efs.Tag{
			Key:   aws.String(k),
			Value: aws.String(v.(string)),
		}
		if !tagIgnoredEFS(t) {
			result = append(result, t)
		}
	}

	return result
}
594471
func (a *Annotator) Tag(tags ...TagValueGenerator) *Annotator {
	if a == nil {
		return a
	}
	tagMap := make(map[TagKey]interface{}, len(tags))
	for _, t := range tags {
		v := t.GenerateErrorTagValue()
		tagMap[v.Key] = v.Value
	}
	if len(tagMap) > 0 {
		if a.ctx.tags == nil {
			a.ctx.tags = tagMap
		} else {
			for k, v := range tagMap {
				a.ctx.tags[k] = v
			}
		}
	}
	return a
}