2
0

Merge remote-tracking branch 'pgtype/master' into v5-dev

This commit is contained in:
Jack Christensen
2022-04-23 11:00:07 -05:00
+4
View File
@@ -337,6 +337,10 @@ func float64AssignTo(srcVal float64, srcValid bool, dst any) error {
if v := reflect.ValueOf(dst); v.Kind() == reflect.Ptr {
el := v.Elem()
switch el.Kind() {
// if dst is a type alias of a float32 or 64, set dst val
case reflect.Float32, reflect.Float64:
el.SetFloat(srcVal)
return nil
// if dst is a pointer to pointer, strip the pointer and try again
case reflect.Ptr:
if el.IsNil() {