Unsigned integers

Using uint without a number generally chooses the largest size for your system, typically 64 bits. You can also specify one of the four specific uint sizes:

  • uint8: Unsigned 8-bit integer (0 to 255)
  • uint16: Unsigned 16-bit integer (0 to 65535)
  • uint32 : Unsigned 32-bit integer (0 to 4294967295)
  • uint64: Unsigned 64-bit integer (0 to 18446744073709551615)

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.