> ## 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 int

In Go, `int` is a built-in, signed integer data type whose memory footprint is architecture-dependent. It resolves to 32 bits (4 bytes) on 32-bit systems and 64 bits (8 bytes) on 64-bit systems.

## Technical Specifications

* **Zero Value:** `0`
* **Size:** Evaluated via `unsafe.Sizeof(int(0))`, yielding `4` or `8` depending on the target compilation architecture (`GOARCH`).
* **Range (32-bit):** -2³¹ to 2³¹-1 (-2,147,483,648 to 2,147,483,647)
* **Range (64-bit):** -2⁶³ to 2⁶³-1 (-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807)

## Syntax and Type Inference

When declaring an untyped integer literal, the Go compiler automatically infers the underlying type as `int`.

```go theme={"dark"}
// Explicit declaration
var a int = 10

// Short variable declaration (type inferred as int)
b := 20

// Zero-value initialization
var c int // c is initialized to 0
```

## Type Identity and Strict Typing

In Go's type system, `int` is a distinct, named type. It is **not** an alias for `int32` or `int64`. Because Go enforces strict typing and lacks implicit type coercion, you cannot assign an `int` to a variable of type `int32` or `int64` without an explicit conversion, even if the underlying architecture guarantees identical bit widths.

```go theme={"dark"}
var x int = 100
var y int64 = 100

// INVALID: Cannot use x (type int) as type int64 in assignment
// y = x 

// VALID: Requires explicit type conversion
y = int64(x)
```

## Memory Alignment

The alignment guarantee for `int` matches its size. Evaluated via `unsafe.Alignof(int(0))`, it aligns to a 4-byte boundary on 32-bit architectures and an 8-byte boundary on 64-bit architectures. This behavior directly impacts struct padding when `int` fields are interleaved with smaller data types like `bool` or `int8`.

<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>
