Created
June 5, 2022 09:05
-
-
Save aligoren/141a4fbc991707ca1289dba9b47dd20e 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() { | |
i := make(chan int) | |
go func() { | |
a := 0 | |
a++ | |
i <- a | |
}() | |
b := <-i | |
b++ | |
fmt.Printf("Number: %d", b) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment