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 TestFloat4Codec(t *testing.T) {
testutil.RunTranscodeTests(t, "float4", []testutil.TranscodeTestCase{
{pgtype.Float4{Float: -1, Valid: true}, new(pgtype.Float4), isExpectedEq(pgtype.Float4{Float: -1, Valid: true})},
{pgtype.Float4{Float: 0, Valid: true}, new(pgtype.Float4), isExpectedEq(pgtype.Float4{Float: 0, Valid: true})},
{pgtype.Float4{Float: 1, Valid: true}, new(pgtype.Float4), isExpectedEq(pgtype.Float4{Float: 1, Valid: true})},
{pgtype.Float4{Float32: -1, Valid: true}, new(pgtype.Float4), isExpectedEq(pgtype.Float4{Float32: -1, Valid: true})},
{pgtype.Float4{Float32: 0, Valid: true}, new(pgtype.Float4), isExpectedEq(pgtype.Float4{Float32: 0, Valid: true})},
{pgtype.Float4{Float32: 1, Valid: true}, new(pgtype.Float4), isExpectedEq(pgtype.Float4{Float32: 1, Valid: true})},
{float32(0.00001), new(float32), isExpectedEq(float32(0.00001))},
{float32(9999.99), new(float32), isExpectedEq(float32(9999.99))},
{pgtype.Float4{}, new(pgtype.Float4), isExpectedEq(pgtype.Float4{})},