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​

  • Booleans — bool, logical operators, and common uses
  • Integers — signed and unsigned integer types, sizes, and bounds
  • Floats — float32 vs float64, precision, and when to use each
  • Strings — UTF-8 encoded text, length, concatenation, raw literals, and byte indexing
  • Bytes — byte (uint8), character literals, and byte slices
  • Runes — rune (int32), Unicode code points, and how runes differ from bytes
  • Complex Numbers — complex64 and complex128, constructing values, and arithmetic