A Comprehensive Guide of Arrays and Slices in Golang (and their differences)
At first, it’s easy to see arrays and slices as the same thing: a data structure to represent collections. However, they are actually quite different from one another. In this post we will explore their differences and implementation in Go. We will then look at some examples so that you can make a more informed decision on when to use them. Arrays An array is a fixed collection of data. The emphasis here is on fixed, because once you set the length of an array, it cannot be changed....