Re:I Love Go; I Hate Go
by matthewmacleod on Tuesday August 02, 2016 @06:35AM
(#12208927)
This is a great example of the sort of thing that frustrates me when I'm using Go. Deleting an element from a slice is an obvious, common, simple operation. In order to do this, I have to build that operation from primitives, despite the fact that it will be more error-prone to do so. There are lots of other annoyances like this, too.
slice[n] = slice[len(slice)-1]
slice = slice[:len(slice)-1]
Probably one should campaign for adding a delete operator to slices, though so far I have never missed it.