SHARE
TWEET

Untitled

a guest May 22nd, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. func JustSleep(flag chan bool){
  2.     time.Sleep(time.Second*5)
  3.     fmt.Println("Sleep finished")
  4.     flag <- true
  5. }
  6.  
  7. func main(){
  8.     flag := make(chan bool, 1)
  9.     go JustSleep(flag)
  10.     <- flag
  11.     fmt.Println("Ending main process")
  12. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top