Skip to content

Instantly share code, notes, and snippets.

@dimonomid
Created June 18, 2018 17:06
Show Gist options
  • Save dimonomid/c5cb72de51720165d980608730eec299 to your computer and use it in GitHub Desktop.
Save dimonomid/c5cb72de51720165d980608730eec299 to your computer and use it in GitHub Desktop.
func main() {
srcSlice := []int{1, 2, 3}
anotherSlice := srcSlice[:3]
for i := 0; i < 3; i++ {
srcSlice[i] += 10
}
fmt.Println(srcSlice)
fmt.Println(anotherSlice)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment