added a simple channel demo

This commit is contained in:
Jian Han 2018-01-04 20:54:33 +10:00
parent abeeb049c5
commit 59d7be9f82

12
channel/basic/main.go Normal file
View file

@ -0,0 +1,12 @@
package main
import "fmt"
func main() {
done := make(chan int)
go func() {
fmt.Println("Hello World")
<-done
}()
done <- 1
}