Signed integers

Like unsigned integers, you can use int by itself to choose the best default size, or specify one of these four specific int sizes:

  • int8: 8-bit integer (-128 to 127)
  • int16: 16-bit integer (-32768 to 32767)
  • int32: 32-bit integer (-2147483648 to 2147483647)
  • int64: 64-bit integer (-9223372036854775808 to 9223372036854775807)

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.