What is a proper way to represent huge numbers from database in GO?
I have a Postgres table with column of numeric
type. Postgres internally represents it as varchar
, allowing it to have virtually unlimited size. My values won't exceed 10 ^ 28
tough. Additionally, this column is nullable
.
I know that go has big.Int
for representing such numbers, but there is no nullable equivalent in sql
package, sql.NullInt64
being the biggest out there.
So what is a proper way of representing such column in go?