Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dumindu/d28be434d81ef0c895c9220d46eecfa2 to your computer and use it in GitHub Desktop.
Save dumindu/d28be434d81ef0c895c9220d46eecfa2 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
)
var closed = make(chan struct{})
func main() {
go write()
<-closed
}
func write() {
fmt.Println("Hello world!")
close(closed)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment