Skip to content

Instantly share code, notes, and snippets.

@elimisteve
Forked from jsgoecke/gist:7738466
Last active December 29, 2015 22:59
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 elimisteve/7739778 to your computer and use it in GitHub Desktop.
Save elimisteve/7739778 to your computer and use it in GitHub Desktop.
Async "Hello, world" in Go. A bit more tidy IMO :-)
go run hello_world.go
Hello world!
package main
import "fmt"
func hello(ch chan string) {
ch <- "Hello world!"
}
func main() {
ch := make(chan string)
go hello(ch)
fmt.Println(<-ch)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment