diff --git a/encode.go b/encode.go index 556986a4..d757b256 100644 --- a/encode.go +++ b/encode.go @@ -18,8 +18,6 @@ func encode(parameterStatus *parameterStatus, x interface{}, pgtypOid oid.Oid) [ switch v := x.(type) { case int64: return []byte(fmt.Sprintf("%d", v)) - case float32: - return []byte(fmt.Sprintf("%.9f", v)) case float64: return []byte(fmt.Sprintf("%.17f", v)) case []byte: @@ -87,8 +85,6 @@ func appendEncodedText(parameterStatus *parameterStatus, buf []byte, x interface switch v := x.(type) { case int64: return strconv.AppendInt(buf, v, 10) - case float32: - return strconv.AppendFloat(buf, float64(v), 'f', -1, 32) case float64: return strconv.AppendFloat(buf, v, 'f', -1, 64) case []byte: diff --git a/encode_test.go b/encode_test.go index 9a33ee08..50fbaf33 100644 --- a/encode_test.go +++ b/encode_test.go @@ -510,15 +510,13 @@ func TestAppendEncodedText(t *testing.T) { buf = appendEncodedText(¶meterStatus{serverVersion: 90000}, buf, int64(10)) buf = append(buf, '\t') - buf = appendEncodedText(¶meterStatus{serverVersion: 90000}, buf, float32(42.0000000001)) - buf = append(buf, '\t') buf = appendEncodedText(¶meterStatus{serverVersion: 90000}, buf, 42.0000000001) buf = append(buf, '\t') buf = appendEncodedText(¶meterStatus{serverVersion: 90000}, buf, "hello\tworld") buf = append(buf, '\t') buf = appendEncodedText(¶meterStatus{serverVersion: 90000}, buf, []byte{0, 128, 255}) - if string(buf) != "10\t42\t42.0000000001\thello\\tworld\t\\\\x0080ff" { + if string(buf) != "10\t42.0000000001\thello\\tworld\t\\\\x0080ff" { t.Fatal(string(buf)) } }