Skip to content

Instantly share code, notes, and snippets.

@jsgoecke
Last active December 29, 2015 22:49
Show Gist options
  • Save jsgoecke/7738466 to your computer and use it in GitHub Desktop.
Save jsgoecke/7738466 to your computer and use it in GitHub Desktop.
package main
import "fmt"
func hello(ch chan string) {
ch <- "Hello world!"
}
func main() {
ch := make(chan string)
go hello(ch)
fmt.Println(<-ch)
}
go run hello_world.go
Hello world!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment