Skip to content

Instantly share code, notes, and snippets.

@yumed15
Created November 23, 2023 09:57
Show Gist options
  • Save yumed15/540d4d55317e7b74c62fd8fd4c54d4bc to your computer and use it in GitHub Desktop.
Save yumed15/540d4d55317e7b74c62fd8fd4c54d4bc to your computer and use it in GitHub Desktop.
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