Resize

The downside of arrays in Go is that they have the restriction of having a fixed length. Therefore, it is impossible to increase the length of an array, as this would imply changing its type.


[2]int != [3]int
// This difference happens because
// the length of the array is part
// of your type.
                        

However, Go offers a way to create dynamic lists of data, called slices.

resize.go