[Go] Declare an array

Created on November 30, 2026

Use var followed by the array name, length, and element type.

var arrayName [length]ElementType

This declaration creates an array named arr that holds five strings.

var arr [5]string
Go