Skip to content

Instantly share code, notes, and snippets.

@aligoren
Created June 5, 2022 09:02
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 aligoren/f4e0a845bf14e41ed144b17f7c34f48f to your computer and use it in GitHub Desktop.
Save aligoren/f4e0a845bf14e41ed144b17f7c34f48f to your computer and use it in GitHub Desktop.
package main
import "fmt"
func main() {
i := make(chan int)
go func() {
a := 0
a++
i <- a
}()
a := <-i
a++
fmt.Printf("Number: %d", a)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment