Skip to content

Instantly share code, notes, and snippets.

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