x = append(x[:n], x[n+1:]...)
But when slices contain pointers, I often forget to set the last element to
nil, which causes it not to be garbage collected.
So I must add this line to clear the last element:
x[:n+1][n] = nil
But it is too easy to forget it.
Would a new "remove" builtin useful for this operation ?
Thus, the decision about setting the last element to nil would be more
Any opinion ?
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firstname.lastname@example.org.
For more options, visit https://groups.google.com/d/optout.