// Gets the float value of a named field.
188362
func (e *GameEvent) GetFloat32(name string) (float32, error) {
	// Get the key from the message
	k, err := e.getEventKey(name)
	if err != nil {
		return 0.0, err
	}

	// Make sure it's a bool.
	if k.GetType() != gameEventTypeFloat {
		return 0.0, _errorf("field %s: expected float, got %s", name, gameEventTypeNames[k.GetType()])
	}

	return k.GetValFloat(), nil
}
1350079
func GetFloat(n ast.Node) (float64, error) {
	if node, ok := n.(*ast.BasicLit); ok && node.Kind == token.FLOAT {
		return strconv.ParseFloat(node.Value, 64)
	}
	return 0.0, fmt.Errorf("Unexpected AST node type: %T", n)
}
1123972
func (r Row) GetFloat64(colIdx int) float64 {
	col := r.c.columns[colIdx]
	return *(*float64)(unsafe.Pointer(&col.data[r.idx*8]))
}
1030998
func GetFloat(key string) (float64, error) {
	value, err := Get(key)
	if err != nil {
		return 0, err
	}
	switch v := value.(type) {
	case float64:
		return v, nil
	case float32:
		return float64(v), nil
	case int:
		return float64(v), nil
	case string:
		if floatVal, err := strconv.ParseFloat(v, 64); err == nil {
			return floatVal, nil
		}
	}
	return 0, &InvalidValue{key, "float"}
}
1303554
func (d Data) GetFloat(key string) float64 {
	if !d.KeyExists(key) || len(d.Values[key]) == 0 {
		return 0.0
	}
	str := d.Get(key)
	if result, err := strconv.ParseFloat(str, 64); err != nil {
		panic(err)
	} else {
		return result
	}
}
541406
func (f *Flash) GetFloat64(key string) float64 {
	r, _ := f.Get(key).(float64)
	return r
}
879001
func (fs *UnstructAdapter) GetFieldValue(path string) (string, error) {
	fields, err := parseFields(path)
	if err != nil {
		return "", err
	}
	s, found, err := unstructured.NestedString(
		fs.UnstructuredContent(), fields...)
	if found || err != nil {
		return s, err
	}
	return "", fmt.Errorf("no field named '%s'", path)
}
421162
func GetFloat64OrDefault(key string, defVal float64) float64 {
	viperLock.RLock()
	defer viperLock.RUnlock()

	if val := viper.GetFloat64(key); val != 0 {
		return val
	}

	return defVal
}
1270042
func (f *Form) GetField(name string) *Field {
	for _, field := range f.Fields {
		if field.Name == name {
			return field
		}
	}
	return nil
}
818248
func GetFieldKind(obj interface{}, name string) (reflect.Kind, error) {
	if !hasValidType(obj, []reflect.Kind{reflect.Struct, reflect.Ptr}) {
		return reflect.Invalid, errors.New("Cannot use GetField on a non-struct interface")
	}

	objValue := reflectValue(obj)
	field := objValue.FieldByName(name)

	if !field.IsValid() {
		return reflect.Invalid, fmt.Errorf("No such field: %s in obj", name)
	}

	return field.Type().Kind(), nil
}
187810
func (c *Config) GetFloat64(key string) (f float64) {
	f, _ = c.GetFloat64Ok(key)
	return
}
1107074
func (fi *fieldInfo) getValue(a reflect.Value) interface{} {
	for _, i := range fi.path {
		a = a.Field(i)
		if a.Kind() == reflect.Ptr {
			if a.IsNil() {
				return nil
			}
			a = a.Elem()
		}
	}
	return a.Interface()
}
884312
func Float32Array(name string, values []float32) FieldOpt {
	return func(em *eventMetadata, ed *eventData) {
		em.writeArray(name, inTypeFloat, outTypeDefault, 0)
		ed.writeUint16(uint16(len(values)))
		for _, v := range values {
			ed.writeUint32(math.Float32bits(v))
		}
	}
}
958564
func (c *Context) Float64(name string) float64 {
	return lookupFloat64(name, c.flagSet)
}
519517
func Float64Field(name string, value float64) FieldOpt {
	return func(em *eventMetadata, ed *eventData) {
		em.writeField(name, inTypeDouble, outTypeDefault, 0)
		ed.writeUint64(math.Float64bits(value))
	}
}
491534
func FloatValue(val string) (*wrappers.FloatValue, error) {
	parsedVal, err := Float32(val)
	return &wrappers.FloatValue{Value: parsedVal}, err
}
969992
func (r Row) GetFloat32(colIdx int) float32 {
	col := r.c.columns[colIdx]
	return *(*float32)(unsafe.Pointer(&col.data[r.idx*4]))
}