Golang zero values
16 August 2024 (Updated 16 August 2024)
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