Skip to content

Instantly share code, notes, and snippets.

@comtom
Created September 27, 2018 19:17
Show Gist options
  • Select an option

  • Save comtom/1868dbe8f23c5d5e8007e6e9f64b57fc to your computer and use it in GitHub Desktop.

Select an option

Save comtom/1868dbe8f23c5d5e8007e6e9f64b57fc to your computer and use it in GitHub Desktop.
func worker(done chan bool) {
fmt.Print("working...")
time.Sleep(time.Second)
fmt.Println("done")
done <- true
}
func main() {
done := make(chan bool, 1)
go worker(done)
<-done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment