···251251 }
252252 for _, c := range d.chunks(t) {
253253 urlDownload.Add(1)
254254- go func(c chunk) {
254254+ go func(c chunk, s DownloadStatus) {
255255 defer urlDownload.Done()
256256 b, err := d.downloadChunk(ctx, url, c)
257257 if err != nil {
···267267 }
268268 s.DownloadedFileBytes += int64(n)
269269 ch <- s
270270- }(c)
270270+ }(c, s)
271271 }
272272}
273273
-1
downloader_test.go
···139139 var got string
140140 defer os.Remove(got)
141141 for g := range DefaultDownloader().Download(s.URL + "/archive.zip") {
142142- fmt.Println(g)
143142 got = g.DownloadedFilePath
144143 if g.Error != nil {
145144 t.Errorf("expected no error during the download of the zip archive, got %s", g.Error)