Create a gist now

Instantly share code, notes, and snippets.

Embed
Playing with Go channels
package main
import "fmt"
func main() {
messages := make(chan string)
return_messages := make(chan string)
go func() { return_messages <- "ping" }()
go func() {
r_msg := <-return_messages
messages <- r_msg
}()
msg := <-messages
fmt.Println(msg)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment