Golang array is a fixed-size collection of items of the same type. The items of an array are stored sequentially and can be accessed using their index. If we want to declare an array in Go, a programmer specifies the type of the elements and the number of items required by an array.

Golang array example

Golang programming language provides a data structure called an** array**, which can store the fixed-size sequential collection of items of the same type.

The array is used to store the collection of data, but it is often more useful to think of the array as the collection of variables of the same type.

Instead of declaring individual variables, such as no1, no2, …, and no99, you declare one array variable such as numbers and use no[0], no[1], and …, no[99] to represent individual variables.

#golang #go

Golang Array Example | Arrays in Go Tutorial Explained
1.40 GEEK