// HandlesFieldName returns true if the given field name should be handled by
// this table join.
484196
func (j *TableJoin) HandlesFieldName(fieldName string) bool {
	for _, t := range j.PrefixActivators {
		if strings.HasPrefix(fieldName, t) {
			return true
		}
	}
	return false
}
113561
func fieldName(x Expr) *Ident {
	switch t := x.(type) {
	case *Ident:
		return t
	case *SelectorExpr:
		if _, ok := t.X.(*Ident); ok {
			return t.Sel
		}
	case *StarExpr:
		return fieldName(t.X)
	}
	return nil
}
657408
func HandlerFields(entry *logrus.Entry, formatter *CustomFormatter) (interface{}, error) {
	var fields string

	// Without sorting no need to get keys from map into a string array.
	if formatter.DisableSorting {
		for key, value := range entry.Data {
			if key == "name" && formatter.Attributes.Contains("name") {
				continue
			}
			fields = fmt.Sprintf("%s %s=%v", fields, Color(entry, formatter, key), value)
		}
		return fields, nil
	}

	// Put keys in a string array and sort it.
	keys := make([]string, len(entry.Data))
	i := 0
	for k := range entry.Data {
		keys[i] = k
		i++
	}
	sort.Strings(keys)

	// Do the rest.
	for _, key := range keys {
		if key == "name" && formatter.Attributes.Contains("name") {
			continue
		}
		fields = fmt.Sprintf("%s %s=%v", fields, Color(entry, formatter, key), entry.Data[key])
	}
	return fields, nil
}
825402
func (m *Mapper) FieldByName(v reflect.Value, name string) reflect.Value {
	v = reflect.Indirect(v)
	mustBe(v, reflect.Struct)

	tm := m.TypeMap(v.Type())
	fi, ok := tm.Names[name]
	if !ok {
		return v
	}
	return FieldByIndexes(v, fi.Index)
}
325397
func (f *FieldSetType) Field(name string) fields.FieldInterface {
	ind, ok := f.fieldMap[name]
	if !ok {
		return &fields.Field{}
	}
	return f.fields[ind].(fields.FieldInterface)
}
1014205
func (q *query) fieldNames() []string {
	switch {
	case q.hasIncludes():
		return q.includes
	case q.hasExcludes():
		results := q.collection.spec.fieldNames()
		for _, name := range q.excludes {
			results = removeElementFromStringSlice(results, name)
		}
		return results
	default:
		return q.collection.spec.fieldNames()
	}
}
428781
func (s *DeleteResolverInput) SetFieldName(v string) *DeleteResolverInput {
	s.FieldName = &v
	return s
}
527165
func (dt *DbfTable) SetFieldValueByName(row int, fieldName string, value string) {
	fieldName = strings.ToUpper(fieldName)
	fieldIndex, ok := dt.fieldMap[fieldName]
	if !ok {
		panic("Field name '" + fieldName + "' does not exist")
	}
	// set field value and return
	dt.SetFieldValue(row, fieldIndex, value)
}
286164
func (nr *nameResolver) handleColumnName(cn *ast.ColumnNameExpr) {
	ctx := nr.currentContext()
	if ctx.inOnCondition {
		// In on condition, only tables within current join is available.
		nr.resolveColumnNameInOnCondition(cn)
		return
	}

	// Try to resolve the column name form top to bottom in the context stack.
	for i := len(nr.contextStack) - 1; i >= 0; i-- {
		if nr.resolveColumnNameInContext(nr.contextStack[i], cn) {
			// Column is already resolved or encountered an error.
			if i < len(nr.contextStack)-1 {
				// If in subselect, the query use outer query.
				nr.currentContext().useOuterContext = true
			}
			return
		}
	}
	nr.Err = errors.Errorf("unknown column %s", cn.Name.Name.L)
}
1155225
func (api *API) Field(ctx context.Context, indexName, fieldName string) (*Field, error) {
	span, _ := tracing.StartSpanFromContext(ctx, "API.Field")
	defer span.Finish()

	if err := api.validate(apiField); err != nil {
		return nil, errors.Wrap(err, "validating api method")
	}

	field := api.holder.Field(indexName, fieldName)
	if field == nil {
		return nil, newNotFoundError(ErrFieldNotFound)
	}
	return field, nil
}
1087347
func formatFieldName(name string) string {
	var formatted string
	for _, v := range strings.Split(name, "-") {
		formatted += strings.Title(v)
	}
	return formatted
}
1002214
func (p *RequestParams) FieldNames() (results []string) {
	if p == nil {
		return
	}
	t := *p
	for _, reqparam := range t {
		results = append(results, reqparam.FieldName)
	}
	return
}
1289040
func (f *FieldCache) FieldNamed(field string, createIfMissing bool) (uint16, bool) {
	f.mutex.RLock()
	if index, ok := f.fieldIndexes[field]; ok {
		f.mutex.RUnlock()
		return index, true
	} else if !createIfMissing {
		f.mutex.RUnlock()
		return 0, false
	}
	// trade read lock for write lock
	f.mutex.RUnlock()
	f.mutex.Lock()
	// need to check again with write lock
	if index, ok := f.fieldIndexes[field]; ok {
		f.mutex.Unlock()
		return index, true
	}
	// assign next field id
	index := f.addLOCKED(field, uint16(f.lastFieldIndex+1))
	f.mutex.Unlock()
	return index, false
}
1035657
func (m *Table) HasField(name string) bool {
	if _, ok := m.FieldMap[name]; ok {
		return true
	}
	return false
}
1289346
func (e EventBuilder) Name() string {
	strs := make([]string, len(e.fields))
	for i, field := range e.fields {
		strs[i] = field.value
	}

	return strings.Join(strs, "")
}
1362036
func (fiInfo *FieldInfo) Name() string {
	tagJSON := ucon.NewTagJSON(fiInfo.Base.Tag)
	name := tagJSON.Name()
	if name == "" {
		name = fiInfo.Base.Name
	}

	return name
}
661808
func (e *Env) FieldNames() []string {
	fieldType := e.Type()

	var fieldNames []string
	for i := 0; i < fieldType.NumField(); i++ {
		field := fieldType.Field(i)
		fieldNames = append(fieldNames, field.Name)
	}
	return fieldNames
}