Created
September 3, 2018 20:18
-
-
Save sw-samuraj/60f7fff1190dea6ea5256de1c6e566c6 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 main() { | |
for i := 0; i <= 9; i++ { | |
i := i // Seems odd, but it's legal and idiomatic. | |
go func() { fmt.Println(i) }() | |
} | |
time.Sleep(100 * time.Millisecond) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment