Created
November 23, 2023 09:57
-
-
Save yumed15/540d4d55317e7b74c62fd8fd4c54d4bc 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