Golang Slices are Dangerous
![](/posts/2023/01/18/golang-slices-are-dangerous/cover-patrick-federi-bvC1ExlcYtk-unsplash_hu9897ab9f3a7818e3b490dd1366d7bf9b_4862448_140x140_fill_q75_box_smart1.jpg)
The headline is a little bit click-bait-y, but I want to highlight one of the easily overlooked risks of using slices in Golang. First of all, there’s nothing really wrong with the way slices work. A trade-off was made. It is not necessarily the same trade-off I would make, but such is engineering.
Consider Arrays First, let’s map what a slice is because it might not be obvious unless you’ve been writing Golang programs for a while.
ยป
read more