Created
October 26, 2017 21:58
-
-
Save lamarmarshall/f4db9314ef1522bdc87ec9048a692c7b to your computer and use it in GitHub Desktop.
go thread concurrency
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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