ZinedinShiqin/go-tour

There's no synchronization between the 2 invocations of say(), so the output shows 5 "hello" line...

Closed this issue · 2 comments

https://feedback.corp.google.com/#/Report/1047827784

Description:
There's no synchronization between the 2 invocations of say(), so the output 
shows 5 "hello" lines and 4 "world" lines - once the main goroutine ("hello") 
is done, the spawned goroutine ("world") doesn't get a chance to finish.

UI language: en
Detected language: en

Original issue reported on code.google.com by feedback...@gmail.com on 15 Jul 2013 at 9:52

That's correct, and working as intended.

Original comment by a...@golang.org on 15 Jul 2013 at 11:46

  • Changed state: Invalid
In that case, do you think maybe it could be made more explicit that this is 
meant to teach us a lesson about this behavior? As it stands, this is 
(presumably) the first thing someone new to Go sees about goroutines, and not 
having a cautionary tale is rather confusing.

Original comment by rez...@google.com on 16 Jul 2013 at 1:48