mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-08 05:50:47 +00:00
Fix: Implement golangci-lint suggestions
This commit is contained in:
+1
-1
@@ -68,7 +68,7 @@ func NewDownloader(downLimit int64, maxTries int, progress aptly.Progress) aptly
|
||||
return downloader
|
||||
}
|
||||
|
||||
func (downloader *downloaderImpl) checkRedirect(req *http.Request, via []*http.Request) error {
|
||||
func (downloader *downloaderImpl) checkRedirect(req *http.Request, _ []*http.Request) error {
|
||||
if downloader.progress != nil {
|
||||
downloader.progress.Printf("Following redirect to %s...\n", req.URL)
|
||||
}
|
||||
|
||||
+2
-2
@@ -61,7 +61,7 @@ func (f *FakeDownloader) Empty() bool {
|
||||
}
|
||||
|
||||
// GetLength returns content length of given url
|
||||
func (f *FakeDownloader) GetLength(ctx context.Context, url string) (int64, error) {
|
||||
func (f *FakeDownloader) GetLength(_ context.Context, url string) (int64, error) {
|
||||
expectation, err := f.getExpectedRequest(url)
|
||||
if err != nil {
|
||||
return -1, err
|
||||
@@ -89,7 +89,7 @@ func (f *FakeDownloader) getExpectedRequest(url string) (*expectedRequest, error
|
||||
}
|
||||
|
||||
// DownloadWithChecksum performs fake download by matching against first expectation in the queue or any expectation, with cheksum verification
|
||||
func (f *FakeDownloader) DownloadWithChecksum(ctx context.Context, url string, filename string, expected *utils.ChecksumInfo, ignoreMismatch bool) error {
|
||||
func (f *FakeDownloader) DownloadWithChecksum(_ context.Context, url string, filename string, expected *utils.ChecksumInfo, ignoreMismatch bool) error {
|
||||
expectation, err := f.getExpectedRequest(url)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
+2
-2
@@ -114,7 +114,7 @@ func (d *GrabDownloader) maybeSetupChecksum(req *grab.Request, expected *utils.C
|
||||
return nil
|
||||
}
|
||||
|
||||
func (d *GrabDownloader) download(ctx context.Context, url string, destination string, expected *utils.ChecksumInfo, ignoreMismatch bool) error {
|
||||
func (d *GrabDownloader) download(_ context.Context, url string, destination string, expected *utils.ChecksumInfo, ignoreMismatch bool) error {
|
||||
// TODO clean up dest dir on permanent failure
|
||||
d.log("Download %s -> %s\n", url, destination)
|
||||
|
||||
@@ -155,7 +155,7 @@ func (d *GrabDownloader) GetProgress() aptly.Progress {
|
||||
return d.progress
|
||||
}
|
||||
|
||||
func (d *GrabDownloader) GetLength(ctx context.Context, url string) (int64, error) {
|
||||
func (d *GrabDownloader) GetLength(_ context.Context, url string) (int64, error) {
|
||||
resp, err := http.Head(url)
|
||||
if err != nil {
|
||||
return -1, err
|
||||
|
||||
Reference in New Issue
Block a user