Created
June 5, 2022 08:41
-
-
Save aligoren/89c13789251f1f9ef335355eb905922e to your computer and use it in GitHub Desktop.
This file contains hidden or 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" | |
func main() { | |
wait := make(chan int) | |
i := 0 | |
go func() { | |
i++ | |
close(wait) | |
}() | |
i++ | |
<-wait | |
fmt.Printf("Number: %d", i) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment