Skip to content

Instantly share code, notes, and snippets.

@lamarmarshall
Created October 26, 2017 21:58
Show Gist options
  • Save lamarmarshall/f4db9314ef1522bdc87ec9048a692c7b to your computer and use it in GitHub Desktop.
Save lamarmarshall/f4db9314ef1522bdc87ec9048a692c7b to your computer and use it in GitHub Desktop.
go thread concurrency
package main
import (
"fmt"
)
func main() {
ch := make(chan bool)
go sayChan(ch)
v := <-ch
fmt.Println(v)
}
func sayChan(ch chan bool) {
fmt.Println("hello from other chan")
ch <- true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment