Created
April 9, 2023 09:37
-
-
Save dumindu/d28be434d81ef0c895c9220d46eecfa2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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