Mark McGranaghan d19153e5f6 publish select
2012-10-11 08:35:16 -07:00

18 lines
421 B
Bash

# When we run this program, we see the output of the
# blocking call first, then the interleaved output of the
# two gouroutines. This interleaving reflects the
# goroutines being run concurrently by the Go runtime.
$ go run goroutines.go
direct : 0
direct : 1
direct : 2
goroutine : 0
going
goroutine : 1
goroutine : 2
<enter>
done
# Next we'll look at a complement to goroutines in
# concurrent Go programs: channels.