Skip to content

Instantly share code, notes, and snippets.

@just1689
Last active April 8, 2018 11:21
Show Gist options
  • Save just1689/bd2a1f626f60f193f6fb48c67342f74c to your computer and use it in GitHub Desktop.
Save just1689/bd2a1f626f60f193f6fb48c67342f74c to your computer and use it in GitHub Desktop.
Waiting for another routine
func hello(done chan bool) {
fmt.Println("Hello world goroutine")
done <- true
}
func main() {
done := make(chan bool)
go hello(done)
<-done
fmt.Println("main function")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment