Array elements start with zero values:
var nums [5]int // All 0
var flags [3]bool // All false
var names [2]string // All ""
You don't need to explicitly initialize elements to zero. Go handles it automatically. This applies to all types.
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
Default initialization
Array elements start with zero values:
var nums [5]int // All 0
var flags [3]bool // All false
var names [2]string // All ""
You don't need to explicitly initialize elements to zero. Go handles it automatically. This applies to all types.