There’s also another, more subtle, reason. Go’s database/sql
package doesn’t actually support any integer values greater than 9223372036854775807 (the maximum value for an int64
). It’s possible that a uint64
value could be greater than this, which would in turn lead to Go generating a runtime error similar to this:
sql: converting argument $1 type: uint64 values with high bit set are not supported
By sticking with an int64
in our Go code, we eliminate the risk of ever encountering this error.