hello everyone noob here, i just dont understand concurrency man i'm really trying 😦
trying to follow along with the examples in the book
func primeFinder(done <-chan interface{}, valuesStream <-chan int) <-chan int {
primeNumberStream := make(chan int)
go func() {
defer close(primeNumberStream)
for v := range valuesStream {
select {
case <-done:
return
case primeNumberStream <- v:
}
}
}()
return primeNumberStream
}
i want this function to be able to return a receive channel of only prime numbers from the valueStream parameter how do i add that logic in this for-select loop?