func yamlTags(t reflect.Type) map[string]int {
	if t.Kind() != reflect.Struct {
		panic(errors.Errorf("cannot get yaml tags on type %s", t))
	}
	tags := make(map[string]int)
	for i := 0; i < t.NumField(); i++ {
		f := t.Field(i)
		if f.Type != reflect.TypeOf("") {
			continue
		}
		if tag := f.Tag.Get("yaml"); tag != "" {
			if i := strings.Index(tag, ","); i >= 0 {
				tag = tag[0:i]
			}
			if tag == "-" {
				continue
			}
			if tag != "" {
				f.Name = tag
			}
		}
		tags[f.Name] = i
	}
	return tags
}
// yamlTags returns a map from yaml tag to the field index for the string fields in the given type.
yamlTags returns a map from yaml tag to the field index for the string fields in the given type.
// yamlTags returns a map from yaml tag to the field index for the string fields in the given type .
func yamlTags(t reflect.Type) map[string]int {
	if t.Kind() != reflect.Struct {
		panic(errors.Errorf("cannot get yaml tags on type %s", t))
	}
	tags := make(map[string]int)
	for i := 0; i < t.NumField(); i++ {
		f := t.Field(i)
		if f.Type != reflect.TypeOf("") {
			continue
		}
		if tag := f.Tag.Get("yaml"); tag != "" {
			if i := strings.Index(tag, ","); i >= 0 {
				tag = tag[0:i]
			}
			if tag == "-" {
				continue
			}
			if tag != "" {
				f.Name = tag
			}
		}
		tags[f.Name] = i
	}
	return tags
}
func yamlTags ( t reflect . Type ) map [ string ] int { if t . Kind ( ) != reflect . Struct { panic ( errors . Errorf ( " " , t ) ) } tags := make ( map [ string ] int ) for i := 0 ; i < t . NumField ( ) ; i ++ { f := t . Field ( i ) if f . Type != reflect . TypeOf ( " " ) { continue } if tag := f . Tag . Get ( " " ) ; tag != " " { if i := strings . Index ( tag , " " ) ; i >= 0 { tag = tag [ 0 : i ] } if tag == " " { continue } if tag != " " { f . Name = tag } } tags [ f . Name ] = i } return tags }
yamlTags returns a map from yaml tag to the field index for the string fields in the given type.
yamlTags returns a map from yaml tag to the field index for the string fields in the given type .