Skip to content

Types

There are 3 basic data types in Go languages which are:

  1. Numbers: numbers are divided into three sub-categories that are:
  • Integers: In Golang, there are 4(four) different sizes for both signed and unsigned integers
Data TypeDescription
int88-bit signed integer, range -128 to 127
int1616-bit signed integer, range -(2^15) to (2^15)-1
int3232-bit signed integer, range -(2^31) to (2^31)-1
int6464-bit signed integer, range -(2^63) to (2^63)-1
uint88-bit unsigned integer, range 0 to 255
uint1616-bit unsigned integer, range 0 to (2^16)-1
uint3232-bit unsigned integer, range 0 to (2^32)-1
uint6464-bit unsigned integer, range 0 to (2^64)-1
intBoth int and uint contain same size, either 32 or 64 bit.
uintBoth int and uint contain same size, either 32 or 64 bit.
byteIt is a synonym of uint8.
  • Float Numbers
Data TypeDescription
float3232-bit IEEE 754 floating-point number
float6464-bit IEEE 754 floating-point number
  • Complex Numbers
Data TypeDescription
complex64Complex numbers which contain float32 as a real and imaginary component.
complex128Complex numbers which contain float64 as a real and imaginary component.
  1. Booleans

  2. Strings