From 05790e007ccc12d46568b10f73d1a0988195c81a Mon Sep 17 00:00:00 2001 From: Jack Christensen Date: Wed, 23 Mar 2016 16:57:31 -0500 Subject: [PATCH] Fix 32-bit GOARCH fixes #129 --- values.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/values.go b/values.go index dd5da146..c2107d3b 100644 --- a/values.go +++ b/values.go @@ -1056,7 +1056,7 @@ func encodeUInt64(w *WriteBuf, oid Oid, value uint64) error { w.WriteInt32(8) w.WriteInt64(int64(value)) } else { - return fmt.Errorf("%d is larger than max int64 %d", value, math.MaxInt64) + return fmt.Errorf("%d is larger than max int64 %d", value, int64(math.MaxInt64)) } default: return fmt.Errorf("cannot encode %s into oid %v", "uint64", oid) @@ -1082,11 +1082,11 @@ func encodeInt(w *WriteBuf, oid Oid, value int) error { return fmt.Errorf("%d is larger than max int32 %d", value, math.MaxInt32) } case Int8Oid: - if value <= math.MaxInt64 { + if int64(value) <= int64(math.MaxInt64) { w.WriteInt32(8) w.WriteInt64(int64(value)) } else { - return fmt.Errorf("%d is larger than max int64 %d", value, math.MaxInt64) + return fmt.Errorf("%d is larger than max int64 %d", value, int64(math.MaxInt64)) } default: return fmt.Errorf("cannot encode %s into oid %v", "uint64", oid) @@ -1918,7 +1918,7 @@ func encodeUInt64Slice(w *WriteBuf, oid Oid, slice []uint64) error { w.WriteInt32(8) w.WriteInt64(int64(v)) } else { - return fmt.Errorf("%d is larger than max bigint %d", v, math.MaxInt64) + return fmt.Errorf("%d is larger than max bigint %d", v, int64(math.MaxInt64)) } }