// TagString build tag string.
175047
func (tag *BuildTag) TagString() string {
	result := tag.Name
	if tag.isNoomitempty() {
		if tag.OmitEmpty {
			result += ",omitempty"
		}
	} else {
		if tag.OmitEmpty || !tag.ShouldEmit {
			result += ",omitempty"
		}
	}
	if tag.String { // TODO add special support for int64
		result += ",string"
	}
	return "json:\"" + result + "\""
}
763937
func (a *Tags) SetString(key, value string) {
	a.Set([]byte(key), []byte(value))
}
348638
func (f *formatter) formatString(b []byte, s string) {
	if len(s) > len(b) {
		f.err = ErrFieldTooLong
		return
	}
	ascii := toASCII(s)
	copy(b, ascii)
	if len(ascii) < len(b) {
		b[len(ascii)] = 0
	}
}
829732
func (s *Statement) Tag(items map[string]string) *Statement {
	c := tag{
		items: items,
	}
	*s = append(*s, c)
	return s
}
1251162
func (c IndexEntries) StringByTag(tag int) string {
	s := c.StringsByTag(tag)
	if s == nil || len(s) == 0 {
		return ""
	}
	return s[0]
}
747905
func (z *Tokenizer) TagName() (name []byte, hasAttr bool) {
	if z.data.start < z.data.end {
		switch z.tt {
		case StartTagToken, EndTagToken, SelfClosingTagToken:
			s := z.buf[z.data.start:z.data.end]
			z.data.start = z.raw.end
			z.data.end = z.raw.end
			return lower(s), z.nAttrReturned < len(z.attr)
		}
	}
	return nil, false
}
871009
func (r *Reader) ReadString() string {
	tag := r.readByte()
	decoder := stringDecoders[tag]
	if decoder == nil {
		castError(tag, "string")
	}
	return decoder(r)
}
827590
func NewTagMatcher(name string, value string) TagMatcher {
	return &tagMatcher{tag: StringTag(name, value)}
}
916851
func (v *vcsCmd) tagSync(dir, tag string) error {
	if v.tagSyncCmd == "" {
		return nil
	}
	if tag != "" {
		for _, tc := range v.tagLookupCmd {
			out, err := v.runOutput(dir, tc.cmd, "tag", tag)
			if err != nil {
				return err
			}
			re := regexp.MustCompile(`(?m-s)` + tc.pattern)
			m := re.FindStringSubmatch(string(out))
			if len(m) > 1 {
				tag = m[1]
				break
			}
		}
	}
	if tag == "" && v.tagSyncDefault != "" {
		return v.run(dir, v.tagSyncDefault)
	}
	return v.run(dir, v.tagSyncCmd, "tag", tag)
}
910931
func buildString(pathSegments []string) string {
	pathSegments = makeSegments(pathSegments)
	urlString := ""
	for _, pathSegment := range pathSegments {
		urlString += "/"
		urlString += url.QueryEscape(pathSegment)
	}
	return urlString
}
673825
func escapeTag(tag reflect.StructTag) string {
	t := string(tag)
	if strings.ContainsRune(t, '`') {
		// there are ` in the string; we can't use ` to enclose the string
		return strconv.Quote(t)
	}
	return "`" + t + "`"
}
1292363
func (tn *tagNode) appendTagNode(tag string) (*tagNode, error) {
	ntn, err := newTagNode(tag)
	if err != nil {
		return nil, err
	}
	tn.appendChild(ntn)
	return ntn, nil
}
720355
func (sf *StructField) TagSettingsSet(key, val string) {
	sf.tagSettingsLock.Lock()
	defer sf.tagSettingsLock.Unlock()
	sf.TagSettings[key] = val
}
280120
func (_m *DFS) Tag(snapshotID string, tagName string) error {
	ret := _m.Called(snapshotID, tagName)

	var r0 error
	if rf, ok := ret.Get(0).(func(string, string) error); ok {
		r0 = rf(snapshotID, tagName)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}
646686
func TagsDeep(obj interface{}, key string) (map[string]string, error) {
	return tags(obj, key, true)
}
1112030
func (f *Field) Tag(key string) string {
	return f.field.Tag.Get(key)
}
429985
func (tn *tagNode) Tag() []string {
	out := make([]string, len(tn.tag))
	copy(out, tn.tag)
	return out
}