Skip to content

Instantly share code, notes, and snippets.

@fizx
Last active December 16, 2015 00:29
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 fizx/5348236 to your computer and use it in GitHub Desktop.
Save fizx/5348236 to your computer and use it in GitHub Desktop.
package main
func main() {
buf := make([]int, 0)
buf = append(buf, 0, 1, 2, 3)
sub := buf[0:2] //hang on to a reference of the beginning of the vector
for {
for i := 0; i < 1000; i++ {
buf = append(buf, i)
}
buf = buf[999:1000]
}
sub = sub
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment