Skip to content

Instantly share code, notes, and snippets.

@mrkplt
Last active August 29, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrkplt/0b06015b4ecd00a55ce8 to your computer and use it in GitHub Desktop.
Save mrkplt/0b06015b4ecd00a55ce8 to your computer and use it in GitHub Desktop.
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