# Pass slice as function argument, and modify the original slice ![rw-book-cover](https://readwise-assets.s3.amazonaws.com/media/uploaded_book_covers/profile_1300767/apple-touch-icon2.png) ## Metadata - Author: [[stackoverflow.com]] - Full Title: Pass slice as function argument, and modify the original slice - Category: #articles - URL: https://stackoverflow.com/questions/49428716/pass-slice-as-function-argument-and-modify-the-original-slice ## Highlights - If you want to pass a slice as a parameter to a function, and have that function modify the original slice, then you have to pass a pointer to the slice: func myAppend(list *[]string, value string) { *list = append(*list, value) } I have no idea if the Go compiler is naive or smart about this; performance is left as an exercise for the comment section. ([View Highlight](https://read.readwise.io/read/01jtnxy6yj8m5n8prmm3s8zjph))