Re: [go-nuts] Blocking waitgroup

2017-01-14 Thread Justin Israel
Hi, I'm seeing a number of issues with your example code... You are creating a slice of channels when you really could just use a single channel to receive all of the results. You wait on a WaitGroup, but the goroutines only call Done() *after* they are able to send their result on the channel.

[go-nuts] Blocking waitgroup

2017-01-14 Thread vyasgiridhar27
I am implementing a multi part file downloader and I need help to find the blocking element in the following piece of code. func downPart(wg *sync.WaitGroup, url string, dataChan chan []byte, range1, range2 int) { defer wg.Done() client := new(http.Client) req, _ := http.NewRequest("GET",