- select {
- case <-ctx.Done():
- return
- case locator := <-indexLocatorChan:
- rdr, size, url, err := kc.Get(locator)
- if err != nil {
- stderr.Print(err)
- errorsChan <- struct{}{}
- continue
- }
- n, err := io.Copy(ioutil.Discard, rdr)
- rdr.Close()
- if n != size || err != nil {
- stderr.Printf("Got %d bytes (expected %d) from %s: %v", n, size, url, err)
- errorsChan <- struct{}{}
- continue
- // Note we don't count the bytes received in
- // partial/corrupt responses: we are measuring
- // throughput, not resource consumption.