// TagPairs returns a function that sets the tag pairs
// to the given value.  The returned function is designed
// to be used in the NewGame constructor.
977889
func TagPairs(tagPairs []*TagPair) func(*Game) {
	return func(g *Game) {
		g.tagPairs = append([]*TagPair(nil), tagPairs...)
	}
}
1236703
func (s *NFSFileShareInfo) SetTags(v []*Tag) *NFSFileShareInfo {
	s.Tags = v
	return s
}
477794
func (s *ComputeResource) SetTags(v map[string]*string) *ComputeResource {
	s.Tags = v
	return s
}
723410
func (a *Agent) SetTags(tags map[string]string) error {
	// Update the tags file if we have one
	if a.agentConf.TagsFile != "" {
		if err := a.writeTagsFile(tags); err != nil {
			a.logger.Printf("[ERR] agent: %s", err)
			return err
		}
	}

	// Set the tags in Serf, start gossiping out
	return a.serf.SetTags(tags)
}
952120
func (r *queryTable) tagKeys() []string {
	tags := []string{}
	for t := range r.row.Tags {
		tags = append(tags, t)
	}
	sort.Strings(tags)
	return tags
}
961668
func (writer *ConsoleWriter) SetTags(tags map[string]string) {
	writer.lock.Lock()
	defer writer.lock.Unlock()

	writer.blog.SetTags(tags)
}
1116423
func (s *DescribeClusterParameterGroupsInput) SetTagValues(v []*string) *DescribeClusterParameterGroupsInput {
	s.TagValues = v
	return s
}
1007934
func (s *UntagUserInput) SetTagKeys(v []*string) *UntagUserInput {
	s.TagKeys = v
	return s
}
484729
func (s *Stack) SetTags(v []*Tag) *Stack {
	s.Tags = v
	return s
}
429500
func (s *DescribeHsmConfigurationsInput) SetTagValues(v []*string) *DescribeHsmConfigurationsInput {
	s.TagValues = v
	return s
}
1206710
func (s *Group) SetTags(v []*TagDescription) *Group {
	s.Tags = v
	return s
}
1153644
func (e *ErrorEntry) SetTags(tags []string) *ErrorEntry {
	e.Tags = tags
	return e
}
1246164
func (s *Disk) SetTags(v []*Tag) *Disk {
	s.Tags = v
	return s
}
584028
func ParsePairs(pairArgs []string, pairType string, supportRemove bool) (newPairs map[string]string, removePairs []string, err error) {
	newPairs = map[string]string{}
	if supportRemove {
		removePairs = []string{}
	}
	var invalidBuf bytes.Buffer
	var invalidBufNonEmpty bool
	for _, pairArg := range pairArgs {
		if strings.Contains(pairArg, "=") && pairArg[0] != '=' {
			parts := strings.SplitN(pairArg, "=", 2)
			if len(parts) != 2 {
				if invalidBufNonEmpty {
					invalidBuf.WriteString(", ")
				}
				invalidBuf.WriteString(pairArg)
				invalidBufNonEmpty = true
			} else {
				newPairs[parts[0]] = parts[1]
			}
		} else if supportRemove && strings.HasSuffix(pairArg, "-") && pairArg != "-" {
			removePairs = append(removePairs, pairArg[:len(pairArg)-1])
		} else {
			if invalidBufNonEmpty {
				invalidBuf.WriteString(", ")
			}
			invalidBuf.WriteString(pairArg)
			invalidBufNonEmpty = true
		}
	}
	if invalidBufNonEmpty {
		err = fmt.Errorf("invalid %s format: %s", pairType, invalidBuf.String())
		return
	}

	return
}
1007787
func (s *DescribeEventSubscriptionsInput) SetTagKeys(v []*string) *DescribeEventSubscriptionsInput {
	s.TagKeys = v
	return s
}
545175
func (r *ReqInfo) SetTags(key string, val string) *ReqInfo {
	if r == nil {
		return nil
	}
	r.Lock()
	defer r.Unlock()
	// Search of tag key already exists in tags
	var updated bool
	for _, tag := range r.tags {
		if tag.Key == key {
			tag.Val = val
			updated = true
			break
		}
	}
	if !updated {
		// Append to the end of tags list
		r.tags = append(r.tags, KeyVal{key, val})
	}
	return r
}
1014351
func (s *DescribeSnapshotSchedulesInput) SetTagKeys(v []*string) *DescribeSnapshotSchedulesInput {
	s.TagKeys = v
	return s
}