Skip to content

Instantly share code, notes, and snippets.

@CatTail
Created March 11, 2015 00:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CatTail/9bd6d379fd5e3195968b to your computer and use it in GitHub Desktop.
Save CatTail/9bd6d379fd5e3195968b to your computer and use it in GitHub Desktop.
Prepend element into slice
func prepend(arr []string, item string) {
return append([]string{item}, arr...)
}
@lukewendling
Copy link

needs return declaration func prepend(arr []string, item string) []string

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment