Skip to content

Instantly share code, notes, and snippets.

@developernaren
Last active July 16, 2021 16:26
Show Gist options
  • Save developernaren/00d71531f2985408e3d17ac1ab8a56bd to your computer and use it in GitHub Desktop.
Save developernaren/00d71531f2985408e3d17ac1ab8a56bd to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
)
func main() {
numberCh := make(chan int, 10)
for i := 1; i <=10; i++ {
numberCh<-i
}
for j := 1; j <=10; j++ {
fmt.Println(<- numberCh)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment