From c906b6a0c930ab862fe6eaa9666ef4b67caa8ffd Mon Sep 17 00:00:00 2001 From: Xpl0itU <24777100+Xpl0itU@users.noreply.github.com> Date: Tue, 29 Aug 2023 20:59:10 +0200 Subject: [PATCH] Rename variable --- downloader.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/downloader.go b/downloader.go index c801b95..8e4b93b 100644 --- a/downloader.go +++ b/downloader.go @@ -28,7 +28,7 @@ type ProgressReporter interface { Cancelled() bool } -func downloadFile(progressWindow ProgressReporter, client *grab.Client, downloadURL string, dstPath string, doRetries bool) error { +func downloadFile(progressReporter ProgressReporter, client *grab.Client, downloadURL string, dstPath string, doRetries bool) error { filePath := filepath.Base(dstPath) for attempt := 1; attempt <= maxRetries; attempt++ { @@ -39,7 +39,7 @@ func downloadFile(progressWindow ProgressReporter, client *grab.Client, download req.BufferSize = bufferSize resp := client.Do(req) - progressWindow.UpdateDownloadProgress(resp, filePath) + progressReporter.UpdateDownloadProgress(resp, filePath) t := time.NewTicker(500 * time.Millisecond) defer t.Stop() @@ -48,8 +48,8 @@ func downloadFile(progressWindow ProgressReporter, client *grab.Client, download for { select { case <-t.C: - progressWindow.UpdateDownloadProgress(resp, filePath) - if progressWindow.Cancelled() { + progressReporter.UpdateDownloadProgress(resp, filePath) + if progressReporter.Cancelled() { resp.Cancel() break Loop }