Instantly share code, notes, and snippets.

Embed
What would you like to do?
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