> ## Documentation Index
> Fetch the complete documentation index at: https://docs.syntblaze.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Go rune

A `rune` in Go is a built-in type alias for `int32` that represents a single Unicode code point. It serves as the language's standard mechanism for isolating and representing individual characters, distinguishing them from raw bytes or standard numeric integers.

## Technical Specifications

* **Underlying Type:** `int32`
* **Memory Footprint:** 4 bytes (32 bits)
* **Zero Value:** `0` (which corresponds to the null character `'\x00'`)
* **Encoding:** Represents a specific Unicode code point, independent of its UTF-8 byte-length representation.

## Syntax and Literals

Rune literals are expressed by enclosing one or more characters in single quotes (`' '`). Go supports multiple ways to define a rune literal, including raw characters, octal/hexadecimal escapes, and Unicode escapes.

```go theme={"dark"}
// Implicit typing (inferred as rune/int32)
var a = 'A'

// Explicit typing
var b rune = 'Ω'

// Escape sequences
var newline rune = '\n'

// Unicode code point escapes
var c rune = '\u03A9'       // 16-bit Unicode escape (Omega)
var d rune = '\U000003A9'   // 32-bit Unicode escape (Omega)
```

## Memory and Type Mechanics

Because Go strings are read-only slices of bytes (`uint8`), accessing a string via a standard index returns a single byte, not a complete character. A `rune` resolves this by allocating exactly 32 bits, which is sufficient to hold any valid Unicode code point (which requires up to 21 bits).

```go theme={"dark"}
// A string containing a 4-byte Unicode character
str := "Go🚀"

// Standard indexing yields a single byte (uint8)
// str[2] returns the first byte of the 🚀 character
fmt.Printf("%T\n", str[2]) // Output: uint8

// Converting to a rune slice yields complete Unicode code points (int32)
runes := []rune(str)
fmt.Printf("%T\n", runes[2]) // Output: int32 (rune)
```

## Iteration Behavior

When iterating over a string using a `for...range` loop, Go implicitly decodes the underlying UTF-8 byte sequence. Instead of yielding individual bytes, the loop yields `rune` values alongside their starting byte index.

```go theme={"dark"}
str := "café"

for index, char := range str {
    // 'char' is strictly of type rune (int32)
    // Because 'é' occupies 2 bytes, the index advances accordingly
    fmt.Printf("Type: %T, Value: %U\n", char, char)
}
```

<div
  style={{ 
display: "flex", 
justifyContent: "space-between", 
alignItems: "center", 
maxWidth: "754px", 
padding: "1rem 0",
marginBottom: "24px"
}}
>
  <span style={{ fontWeight: "bold", fontSize: "1.25rem", color: "var(--tw-prose-headings)", fontFamily: "Inter, ui-sans-serif, system-ui, sans-serif" }}>Tired of Poor Go Skills? Fix That With Deep Grasping!</span>

  <a
    href="https://syntblaze.com"
    target="_blank"
    style={{ 
  marginLeft: "24px",
  textDecoration: "none", 
  backgroundColor: "#007AFF",
  color: "#ffffff", 
  padding: "6px 16px", 
  borderRadius: "16px",
  fontSize: "0.9rem",
  fontWeight: "600",
  textAlign: "center",
  transition: "background-color 0.2s ease"
}}
  >
    Learn More
  </a>
</div>

<div style={{ display: "flex", gap: "12px", flexWrap: "wrap" }}>
  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/skill-tracking.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=b9b0305c93bb501c9e767b5c76c88835" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/skill-tracking.png" />

  <img src="https://mintcdn.com/syntblazellc/23tyuOzaWS88qFlc/images/nuggets.png?fit=max&auto=format&n=23tyuOzaWS88qFlc&q=85&s=c86c80197299762989e9b882419b2109" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/nuggets.png" />

  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/bite-sized-exercises.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=a65f9a38c37ff28ab73ed783c53c60e3" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/bite-sized-exercises.png" />
</div>

<div style={{ display: "flex", gap: "12px", flexWrap: "wrap", marginTop: "12px" }}>
  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/mastery-chain.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=748a1763454713e679260fbb95f154a2" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/mastery-chain.png" />

  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/element-previews.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=242f61448ff5dd6deaaab2dccc13b507" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/element-previews.png" />

  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/element-explanations.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=cf0fc1c31f9cd0fc26716781be05fbc9" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/element-explanations.png" />
</div>
