lean into examples
This commit is contained in:
15
examples/goroutines/goroutines.go
Normal file
15
examples/goroutines/goroutines.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func f(n int) {
|
||||
for i := 0; i < 10; i++ {
|
||||
fmt.Println(n, ":", i)
|
||||
}
|
||||
}
|
||||
|
||||
func main() {
|
||||
go f(0)
|
||||
var input string
|
||||
fmt.Scanln(&input)
|
||||
}
|
||||
Reference in New Issue
Block a user