Skip to content

Instantly share code, notes, and snippets.

@glesica
Created January 27, 2015 03:08
Show Gist options
  • Save glesica/96c398c83f2648c6eed9 to your computer and use it in GitHub Desktop.
Save glesica/96c398c83f2648c6eed9 to your computer and use it in GitHub Desktop.
Hello, world! using a goroutine
package main
import (
"fmt"
)
func main() {
myChan := make(chan string)
go func() {
fmt.Println(<-myChan)
}()
myChan <- "Hello, world!"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment