Generic numbers

These generic types can be used when you don't particularly care about whether a number is 32- or 64-bits. The largest available size will automatically be used, but will be compatible with 32- and 64-bit processors.

  • uint: This is an unsigned integer of either 32 or 64 bits
  • int: This is a signed integer with the same size as uint
  • uintptr: This is an unsigned integer to store a pointer value

Get Security with Go now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.