Golang zero values
16 August 2024 (Updated 18 May 2025)
Variables declared without an explicit initial value are given their zero value.
The zero value is:
- numeric types:
0 - pointers:
nil - slices:
nil - maps:
nul - boolean types:
false - strings:
""
Tagged:
Golang