driver/converter.go
func convertNvFloat(v interface{}, max float64) (driver.Value, error) {

	if v == nil {
		return v, nil
	}

	rv := reflect.ValueOf(v)
	switch rv.Kind() {

	case reflect.Float32, reflect.Float64:
		f64 := rv.Float()
		if math.Abs(f64) > max {
			return nil, ErrFloatOutOfRange
		}
		return f64, nil
	case reflect.Ptr:
		// indirect pointers
		if rv.IsNil() {
			return nil, nil
		}
		return convertNvFloat(rv.Elem().Interface(), max)
	}

	return nil, fmt.Errorf("unsupported float conversion type error %[1]T %[1]v", v)
}
func convertNvFloat(v interface{}, max float64) (driver.Value, error) {

	if v == nil {
		return v, nil
	}

	rv := reflect.ValueOf(v)
	switch rv.Kind() {

	case reflect.Float32, reflect.Float64:
		f64 := rv.Float()
		if math.Abs(f64) > max {
			return nil, ErrFloatOutOfRange
		}
		return f64, nil
	case reflect.Ptr:
		// indirect pointers
		if rv.IsNil() {
			return nil, nil
		}
		return convertNvFloat(rv.Elem().Interface(), max)
	}

	return nil, fmt.Errorf("unsupported float conversion type error %[1]T %[1]v", v)
}
func convertNvFloat ( v interface { } , max float64 ) ( driver . Value , error ) { if v == nil { return v , nil } rv := reflect . ValueOf ( v ) switch rv . Kind ( ) { case reflect . Float32 , reflect . Float64 : f64 := rv . Float ( ) if math . Abs ( f64 ) > max { return nil , ErrFloatOutOfRange } return f64 , nil case reflect . Ptr : // indirect pointers if rv . IsNil ( ) { return nil , nil } return convertNvFloat ( rv . Elem ( ) . Interface ( ) , max ) } return nil , fmt . Errorf ( " " , v ) }
// float types
float types