// getErrorFieldName returns the name that should be used to represent the validation error of a struct field.
325612
func getErrorFieldName(f *reflect.StructField) string {
	if tag := f.Tag.Get(ErrorTag); tag != "" {
		if cps := strings.SplitN(tag, ",", 2); cps[0] != "" {
			return cps[0]
		}
	}
	return f.Name
}
1183133
func flagName(field reflect.StructField) (flagname string) {
	var ok bool
	if flagname, ok = field.Tag.Lookup("flag"); ok {
		return flagname
	}

	if flagname, ok = field.Tag.Lookup("json"); ok {
		return flagname
	}
	flagname = field.Name

	return downcaseAndDash(flagname)
}
98938
func (c *CodeOfConduct) GetName() string {
	if c == nil || c.Name == nil {
		return ""
	}
	return *c.Name
}
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
}
622724
func (self *StructFieldDef) Validate() error {
	if self.Name == "" {
		return fmt.Errorf("StructFieldDef.name is missing but is a required field")
	} else {
		val := Validate(RdlSchema(), "Identifier", self.Name)
		if !val.Valid {
			return fmt.Errorf("StructFieldDef.name does not contain a valid Identifier (%v)", val.Error)
		}
	}
	if self.Type == "" {
		return fmt.Errorf("StructFieldDef.type is missing but is a required field")
	} else {
		val := Validate(RdlSchema(), "TypeRef", self.Type)
		if !val.Valid {
			return fmt.Errorf("StructFieldDef.type does not contain a valid TypeRef (%v)", val.Error)
		}
	}
	return nil
}
1047559
func (n *Interface) GetName() (string, error) {
	var err C.virError
	result := C.virInterfaceGetNameWrapper(n.ptr, &err)
	if result == nil {
		return "", makeError(&err)
	}
	name := C.GoString(result)
	return name, nil
}
376562
func (this *SiestaClient) GetErrorType(err error) ErrorType {
	switch {
	case err == siesta.ErrOffsetOutOfRange:
		return ErrorTypeOffsetOutOfRange
	case err == siesta.ErrEOF:
		return ErrorTypeCorruptedResponse
	default:
		return ErrorTypeOther
	}
}
589875
func ErrorByField(e error, field string) string {
	if e == nil {
		return ""
	}
	return ErrorsByField(e)[field]
}
781199
func extractName(sf reflect.StructField) string {
	name := sf.Tag.Get("param")
	if name == "" {
		name = sf.Tag.Get("json")
		idx := strings.IndexRune(name, ',')
		if idx >= 0 {
			name = name[:idx]
		}
	}
	if name == "" {
		name = sf.Name
	}

	return name
}
1270042
func (f *Form) GetField(name string) *Field {
	for _, field := range f.Fields {
		if field.Name == name {
			return field
		}
	}
	return nil
}
793537
func (f *Field) AddError(err string) FieldInterface {
	f.errors = append(f.errors, err)
	return f
}
622351
func (fn *GaussDecayFunction) FieldName(fieldName string) *GaussDecayFunction {
	fn.fieldName = fieldName
	return fn
}
1004735
func (dt *DbfTable) FieldValueByName(row int, fieldName string) string {
	fieldName = strings.ToUpper(fieldName)
	fieldIndex, ok := dt.fieldMap[fieldName]
	if !ok {
		panic("Field name '" + fieldName + "' does not exist")
	}
	return dt.FieldValue(row, fieldIndex)
}
1326418
func (office *Office) GetError() string {
	message := C.get_error(office.handle)
	return C.GoString(message)
}
581163
func GetErrorNum(err error) (errorNum int, ok bool) {
	e, ok := err.(arangoError)
	if !ok || e.errorNum == 0 {
		return 0, false
	}
	return e.errorNum, true
}
905564
func GetField(obj interface{}, name string) (interface{}, error) {
	if !hasValidType(obj, []reflect.Kind{reflect.Struct, reflect.Ptr}) {
		return nil, errors.New("Cannot use GetField on a non-struct interface")
	}

	objValue := reflectValue(obj)
	field := objValue.FieldByName(name)
	if !field.IsValid() {
		return nil, fmt.Errorf("No such field: %s in obj", name)
	}

	return field.Interface(), nil
}
1188587
func (obj *Doc) GetFieldOnTheFlyByName(ctx context.Context, readableName string) (string, error) {
	result := &struct {
		Name string	`json:"qName"`
	} {}
	err := obj.rpc(ctx, "GetFieldOnTheFlyByName", result, readableName)
	return result.Name, err 
}