Skip to content

Instantly share code, notes, and snippets.

@lakinduakash
Last active May 19, 2019 21:19
Show Gist options
  • Save lakinduakash/98e896cc1f0f71779eb4eea2d350cbc0 to your computer and use it in GitHub Desktop.
Save lakinduakash/98e896cc1f0f71779eb4eea2d350cbc0 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
)
func world(c chan string) {
c <- "World!"
fmt.Println("World finished")
}
func main() {
c := make(chan string)
go world(c)
fmt.Println("Hello")
s := <-c
fmt.Println(s)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment