From c45dcc91780edce5d78b72218f8cf853f48189ec Mon Sep 17 00:00:00 2001 From: "Stephen M. McQuay" Date: Mon, 3 Sep 2012 08:37:10 -0600 Subject: [PATCH] hello world for concurrency --- concurrency/hello/go.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 concurrency/hello/go.go diff --git a/concurrency/hello/go.go b/concurrency/hello/go.go new file mode 100644 index 0000000..88d4579 --- /dev/null +++ b/concurrency/hello/go.go @@ -0,0 +1,18 @@ +package main + +import ( + "fmt" + "time" +) + +func say(s string) { + for i := 0; i < 5; i++ { + time.Sleep(time.Millisecond * 100) + fmt.Print(s) + } +} + +func main() { + go say("world!!\n") + say("hello ") +}