Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Prodentim Probiotics Specially Designed For The Health Of Your Teeth And Gums

Instant Grammar Checker - Correct all grammar errors and enhance your writing

Teach Your Child To Read

Powerful WordPress hosting for WordPress professionals

Disclosure: My content contains affiliate links.

31,104 questions

40,777 answers

573 users

How to use buffered channel in Go

1 Answer

0 votes
package main

import "fmt"

func main() {
	ch := make(chan int, 3)
	
	ch <- 234
	ch <- 874
	ch <- 127
	
	fmt.Println(<-ch)
	fmt.Println(<-ch)
	fmt.Println(<-ch)
}


/*
run:

234
874
127

*/

 





answered Apr 3, 2020 by avibootz

Related questions

4 answers 62 views
62 views asked Jun 10, 2023 by avibootz
1 answer 30 views
30 views asked Jun 9, 2023 by avibootz
1 answer 46 views
1 answer 86 views
86 views asked Oct 19, 2021 by avibootz
4 answers 128 views
128 views asked Mar 1, 2021 by avibootz
...