Skip to content

Instantly share code, notes, and snippets.

@refs
Created March 25, 2021 13:39
Show Gist options
  • Save refs/2de8f961911bc6c39da90bc219dd8f47 to your computer and use it in GitHub Desktop.
Save refs/2de8f961911bc6c39da90bc219dd8f47 to your computer and use it in GitHub Desktop.
golang memory bomb
package main
func main() {
a := make([]int, 2, 4)
for i := 0; i < cap(a); i++ {
a = append(a, i)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment