From 57394dabab1ca90c2b11f14206c45e0f7cb42761 Mon Sep 17 00:00:00 2001 From: Lennart Altenhof Date: Wed, 13 Dec 2023 22:56:03 +0100 Subject: [PATCH] fix: fix float sql encoding The Value functions in both float32.go and float64.go have been updated so that they are non-pointer receivers. This change ensures the Valuer interface is satisfied and properly implemented by the Float32 and Float64 types. --- float32.go | 2 +- float64.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/float32.go b/float32.go index e87659d..50e9a7f 100644 --- a/float32.go +++ b/float32.go @@ -53,7 +53,7 @@ func (f *Float32) Scan(src any) error { } // Value returns the value for satisfying the driver.Valuer interface. -func (f *Float32) Value() (driver.Value, error) { +func (f Float32) Value() (driver.Value, error) { return sql.NullFloat64{ Float64: float64(f.Float32), Valid: f.Valid, diff --git a/float64.go b/float64.go index c89c82e..2d70a79 100644 --- a/float64.go +++ b/float64.go @@ -53,7 +53,7 @@ func (f *Float64) Scan(src any) error { } // Value returns the value for satisfying the driver.Valuer interface. -func (f *Float64) Value() (driver.Value, error) { +func (f Float64) Value() (driver.Value, error) { return sql.NullFloat64{ Float64: f.Float64, Valid: f.Valid,