As we know, Go slices hover on top of fixed arrays; modifying elements in a slice also modifies the underlying array. In some scenarios, that’s unacceptable. Hence, we need slice copying! 1. Use slices.Clone slices.Clone is available from Go 1.21 onward. What’s cool about it is that it takes care of the pre-allocation of space… Continue reading Copying slices in Go