👋 Hey Gophers, in this video, we are going to take a quick look at the main differences between an Array in Go and a Slice in Go.
Arrays vs Slices in Go
The main difference between an Array object in Go and a Slice object is that the Slice is effectively an abstraction built on-top of the Array. They give us programmers a greater degree of flexibility when it comes to working with this particular data structure as they handle things like the automatic resizing of arrays whenever we hit a limit.
In most situations, you are not likely going to want to specify an exact length of an array so it’s likely that you’l end up just resorting to Slices for the majority of your use cases.