objutil/tag.go
func ParseTag(s string) Tag {
	var name string
	var omitzero bool
	var omitempty bool

	name, s = parseNextTagToken(s)

	for len(s) != 0 {
		var token string
		switch token, s = parseNextTagToken(s); token {
		case "omitempty":
			omitempty = true
		case "omitzero":
			omitzero = true
		}
	}

	return Tag{
		Name:      name,
		Omitempty: omitempty,
		Omitzero:  omitzero,
	}
}
func ParseTag(s string) Tag {
	var name string
	var omitzero bool
	var omitempty bool

	name, s = parseNextTagToken(s)

	for len(s) != 0 {
		var token string
		switch token, s = parseNextTagToken(s); token {
		case "omitempty":
			omitempty = true
		case "omitzero":
			omitzero = true
		}
	}

	return Tag{
		Name:      name,
		Omitempty: omitempty,
		Omitzero:  omitzero,
	}
}
// ParseTag parses a raw tag obtained from a struct field, returning the results
// as a tag value.