Created
March 25, 2021 13:39
-
-
Save refs/2de8f961911bc6c39da90bc219dd8f47 to your computer and use it in GitHub Desktop.
golang memory bomb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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