Created
April 6, 2011 01:07
-
-
Save sunilnandihalli/904930 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
| func main() { | |
| var( a = [...]int {81,32,45} | |
| chin = make(chan int) | |
| chout = make(chan int) | |
| ) | |
| f1:=func() { | |
| for d:=range chout { | |
| println("d : %d" ,d); | |
| } | |
| } | |
| f2:=func() { | |
| for i:= range a { | |
| chin<- i; | |
| dd:= <-chin | |
| chout<- dd | |
| } | |
| } | |
| go f1() | |
| f2() | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment