2
0

pgtype Float4 and Float8 fields include bit size

e.g. Instead of Float it is Float64. This matches the pattern set by the
database/sql types.
This commit is contained in:
Jack Christensen
2022-03-05 09:20:03 -06:00
parent d723a4ab6f
commit 84a3d91322
9 changed files with 57 additions and 57 deletions
+3 -3
View File
@@ -9,9 +9,9 @@ import (
func TestFloat8Codec(t *testing.T) {
testutil.RunTranscodeTests(t, "float8", []testutil.TranscodeTestCase{
{pgtype.Float8{Float: -1, Valid: true}, new(pgtype.Float8), isExpectedEq(pgtype.Float8{Float: -1, Valid: true})},
{pgtype.Float8{Float: 0, Valid: true}, new(pgtype.Float8), isExpectedEq(pgtype.Float8{Float: 0, Valid: true})},
{pgtype.Float8{Float: 1, Valid: true}, new(pgtype.Float8), isExpectedEq(pgtype.Float8{Float: 1, Valid: true})},
{pgtype.Float8{Float64: -1, Valid: true}, new(pgtype.Float8), isExpectedEq(pgtype.Float8{Float64: -1, Valid: true})},
{pgtype.Float8{Float64: 0, Valid: true}, new(pgtype.Float8), isExpectedEq(pgtype.Float8{Float64: 0, Valid: true})},
{pgtype.Float8{Float64: 1, Valid: true}, new(pgtype.Float8), isExpectedEq(pgtype.Float8{Float64: 1, Valid: true})},
{float64(0.00001), new(float64), isExpectedEq(float64(0.00001))},
{float64(9999.99), new(float64), isExpectedEq(float64(9999.99))},
{pgtype.Float8{}, new(pgtype.Float8), isExpectedEq(pgtype.Float8{})},