// Name returns a Go-ified name for the AnyType.
186927
func (at AnyType) Name(d Domain) string {
	if at.IDName != "" {
		return nameInDomain(d, at.IDName, "")
	}

	return lint.Name(at.NameName)
}
93253
func (fi headerFileInfo) Name() string {
	if fi.IsDir() {
		return path.Base(path.Clean(fi.h.Name))
	}
	return path.Base(fi.h.Name)
}
451564
func (r *Route) Name(name string) *Route {
	r.name = name
	r.group.router.routes[name] = r
	return r
}
739283
func (e Event) Name() string {
	return lint.Name(strings.Title(e.NameName))
}
1164872
func (r *rawNamer) Name(t *types.Type) string {
	if r.Names == nil {
		r.Names = Names{}
	}
	if name, ok := r.Names[t]; ok {
		return name
	}
	if t.Name.Package != "" {
		var name string
		if r.tracker != nil {
			r.tracker.AddType(t)
			if t.Name.Package == r.pkg {
				name = t.Name.Name
			} else {
				name = r.tracker.LocalNameOf(t.Name.Package) + "." + t.Name.Name
			}
		} else {
			if t.Name.Package == r.pkg {
				name = t.Name.Name
			} else {
				name = filepath.Base(t.Name.Package) + "." + t.Name.Name
			}
		}
		r.Names[t] = name
		return name
	}
	var name string
	switch t.Kind {
	case types.Builtin:
		name = t.Name.Name
	case types.Map:
		name = "map[" + r.Name(t.Key) + "]" + r.Name(t.Elem)
	case types.Slice:
		name = "[]" + r.Name(t.Elem)
	case types.Pointer:
		name = "*" + r.Name(t.Elem)
	case types.Struct:
		elems := []string{}
		for _, m := range t.Members {
			elems = append(elems, m.Name+" "+r.Name(m.Type))
		}
		name = "struct{" + strings.Join(elems, "; ") + "}"
	case types.Chan:
		// TODO: include directionality
		name = "chan " + r.Name(t.Elem)
	case types.Interface:
		// TODO: add to name test
		elems := []string{}
		for _, m := range t.Methods {
			// TODO: include function signature
			elems = append(elems, m.Name.Name)
		}
		name = "interface{" + strings.Join(elems, "; ") + "}"
	case types.Func:
		// TODO: add to name test
		params := []string{}
		for _, pt := range t.Signature.Parameters {
			params = append(params, r.Name(pt))
		}
		results := []string{}
		for _, rt := range t.Signature.Results {
			results = append(results, r.Name(rt))
		}
		name = "func(" + strings.Join(params, ",") + ")"
		if len(results) == 1 {
			name += " " + results[0]
		} else if len(results) > 1 {
			name += " (" + strings.Join(results, ",") + ")"
		}
	default:
		name = "unnameable_" + string(t.Kind)
	}
	r.Names[t] = name
	return name
}
534903
func (v *TypeReference) GetName() (o string) {
	if v != nil {
		o = v.Name
	}
	return
}
570825
func (st *BuildStruct) Name() string {
	// FooBar -> fooBar
	// IIS -> iis
	// AEData -> aeData

	name := st.SimpleName()

	if !st.Private {
		return name
	}
	if len(name) <= 1 {
		return strings.ToLower(name)
	}
	if name == strings.ToUpper(name) {
		return strings.ToLower(name)
	}

	runeNames := []rune(name)
	if unicode.IsLower(runeNames[0]) {
		return name
	} else if unicode.IsLower(runeNames[1]) {
		return string(unicode.ToLower(runeNames[0])) + string(runeNames[1:])
	}

	var idx int
	for idx = 0; idx < len(runeNames); idx++ {
		r := runeNames[idx]
		if unicode.IsLower(r) {
			break
		}
	}

	return strings.ToLower(string(runeNames[0:idx-1])) + string(runeNames[idx-1:])
}
84961
func Name(input string) error {
	if govalidator.StringMatches(input, namePattern) {
		return nil
	}

	return NewValidationError(fmt.Sprintf(nameErrorPattern, "Names"))
}
302752
func (s *XPackSecurityPutRoleMappingService) Name(name string) *XPackSecurityPutRoleMappingService {
	s.name = name
	return s
}
682977
func (r *Route) Name(name string) *Route {
	r.name = name
	r.group.router.namedRoutes[name] = r
	return r
}
1352510
func (p Primitive) Name() string {
	switch p {
	case Boolean:
		return "boolean"
	case Integer:
		return "integer"
	case Number:
		return "number"
	case String, DateTime, UUID:
		return "string"
	case Any:
		return "any"
	case File:
		return "file"
	default:
		panic("unknown primitive type") // bug
	}
}
811394
func (n *TagOverrideNamer) Name(t *types.Type) string {
	if nameOverride := extractTag(n.tagName, append(t.SecondClosestCommentLines, t.CommentLines...)); nameOverride != "" {
		return nameOverride
	}

	return n.fallback.Name(t)
}
1340588
func (pg *PluralGroup) Name() string {
	n := strings.Title(pg.Locales)
	return strings.Replace(n, " ", "", -1)
}
149503
func (o *Opts) Name(name string) *Opts {
	o.name = name
	return o
}
532159
func (p Person) Name(v reflect.Value) (interface{}, error) {
	return p.name(), nil
}
597587
func (t *Track) Name() string {
	return C.GoString(C.sp_track_name(t.sp_track))
}
601387
func typeName(att *design.AttributeDefinition) (name string) {
	if ut, ok := att.Type.(*design.UserTypeDefinition); ok {
		name = Goify(ut.TypeName, true)
	} else if mt, ok := att.Type.(*design.MediaTypeDefinition); ok {
		name = Goify(mt.TypeName, true)
	}
	return
}