Created
November 23, 2023 09:58
-
-
Save yumed15/4df0ffbdaf7e1c1ac3a84336e5fb4da4 to your computer and use it in GitHub Desktop.
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 | |
import ( | |
"fmt" | |
"time" | |
) | |
func printVal(n *int) { | |
fmt.Println(*n) | |
} | |
func main() { | |
for i := 0; i < 5; i++ { | |
go printVal(&i) | |
} | |
time.Sleep(100 * time.Millisecond) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment