Skip to content

Instantly share code, notes, and snippets.

@dumindu
Last active March 29, 2020 10:57
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 dumindu/d728128e5086070d624cc40101e4f490 to your computer and use it in GitHub Desktop.
Save dumindu/d728128e5086070d624cc40101e4f490 to your computer and use it in GitHub Desktop.
package main
import "fmt"
func main() {
ch := make(chan string)
go write(ch)
fmt.Println(<-ch)
}
func write(ch chan string) {
ch <- "Hello world!"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment