Skip to content

Commit

Permalink
fix: fix float sql encoding
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Lennart Altenhof authored and lefinal committed Dec 13, 2023
1 parent b43e5a1 commit 57394da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion float32.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion float64.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 57394da

Please sign in to comment.