#Order does matter func remove(slice []int, s int) []int { return append(slice[:s], slice[s+1:]...) #Order does not matter func remove(s []int, i int) []int { s[i] = s[len(s)-1] return s[:len(s)-1] }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter