Skip to main content

Types

Go is statically typed — every variable has a fixed type set at compile time. This section covers the built-in primitive types.

What's Covered

  • Booleansbool, logical operators, and common uses
  • Integers — signed and unsigned integer types, sizes, and bounds
  • Floatsfloat32 vs float64, precision, and when to use each
  • Strings — UTF-8 encoded text, length, concatenation, raw literals, and byte indexing
  • Bytesbyte (uint8), character literals, and byte slices
  • Runesrune (int32), Unicode code points, and how runes differ from bytes
  • Complex Numberscomplex64 and complex128, constructing values, and arithmetic