From 59d7be9f8223fab1e4515b64dd6896511fdb1a1f Mon Sep 17 00:00:00 2001 From: Jian Han Date: Thu, 4 Jan 2018 20:54:33 +1000 Subject: [PATCH] added a simple channel demo --- channel/basic/main.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 channel/basic/main.go diff --git a/channel/basic/main.go b/channel/basic/main.go new file mode 100644 index 0000000..fe1c3fe --- /dev/null +++ b/channel/basic/main.go @@ -0,0 +1,12 @@ +package main + +import "fmt" + +func main() { + done := make(chan int) + go func() { + fmt.Println("Hello World") + <-done + }() + done <- 1 +}