Skip to content

Instantly share code, notes, and snippets.

@gerep
Created November 5, 2014 12:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gerep/b09a3e2394c1b211dca0 to your computer and use it in GitHub Desktop.
Save gerep/b09a3e2394c1b211dca0 to your computer and use it in GitHub Desktop.
func main() {
scores := []int{1,2,3,4,5}
scores = removeAtIndex(scores, 2)
}
func removeAtIndex(source []int, index int) []int {
source = append(source[:index], source[index+1:]...)
return source
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment