News for hackers. Stuff that matters.
Re:I Love Go; I Hate Go by _ph_ on Tuesday August 02, 2016 @05:27AM (#12208720)
If the order of the elements in a slice does not matter, this should be the easiest solution for deleting the element "n":

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.

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.