Skip to content

Instantly share code, notes, and snippets.

@tilaklodha
Created September 24, 2017 23:58
Show Gist options
  • Save tilaklodha/4c322e5207b435ecd6f6288f3ab8b5cc to your computer and use it in GitHub Desktop.
Save tilaklodha/4c322e5207b435ecd6f6288f3ab8b5cc to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
)
func print(ch chan bool) {
fmt.Println("Printing from goroutine")
ch <- true
}
func main() {
ch := make(chan bool)
go print(ch)
<-ch
fmt.Println("Printing from main")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment