Skip to content

Commit 5f3bc99

Browse files
Appease linter
1 parent 7c5b688 commit 5f3bc99

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

internal/updater/http_client.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ func (c *Client) FetchZip(ctx context.Context, zipURL string) (io.ReadCloser, in
137137
// DownloadFile downloads a file from a URL into the specified path. An optional config and options may be passed (or nil to use the defaults).
138138
// A DownloadProgressCB callback function must be passed to monitor download progress.
139139
// If a not empty queryParameter is passed, it is appended to the URL for analysis purposes.
140-
func DownloadFile(ctx context.Context, path *paths.Path, URL string, label string, downloadCB flasher.DownloadProgressCB, config downloader.Config, options ...downloader.DownloadOptions) (returnedError error) {
141-
downloadCB.Start(URL, label)
140+
func DownloadFile(ctx context.Context, path *paths.Path, url string, label string, downloadCB flasher.DownloadProgressCB, config downloader.Config, options ...downloader.DownloadOptions) (returnedError error) {
141+
downloadCB.Start(url, label)
142142
defer func() {
143143
if returnedError == nil {
144144
downloadCB.End(true, "")
@@ -147,7 +147,7 @@ func DownloadFile(ctx context.Context, path *paths.Path, URL string, label strin
147147
}
148148
}()
149149

150-
d, err := downloader.DownloadWithConfigAndContext(ctx, path.String(), URL, config, options...)
150+
d, err := downloader.DownloadWithConfigAndContext(ctx, path.String(), url, config, options...)
151151
if err != nil {
152152
return err
153153
}

service/service_download.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func (s *flasherServerImpl) Download(req *flasher.DownloadRequest, stream flashe
2929
syncSend := NewSynchronizedSend(stream.Send)
3030
ctx := stream.Context()
3131
downloadCB := func(p *flasher.DownloadProgress) {
32-
syncSend.Send(&flasher.DownloadResponse{
32+
_ = syncSend.Send(&flasher.DownloadResponse{
3333
Message: &flasher.DownloadResponse_Progress{Progress: p},
3434
})
3535
}

service/service_flash.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func (s *flasherServerImpl) Flash(req *flasher.FlashRequest, stream flasher.Flas
3838
}
3939
ctx := stream.Context()
4040
downloadCB := func(msg *flasher.DownloadProgress) {
41-
responseCallback(&flasher.FlashResponse{
41+
_ = responseCallback(&flasher.FlashResponse{
4242
Message: &flasher.FlashResponse_DownloadProgress{
4343
DownloadProgress: &flasher.DownloadProgress{
4444
Message: msg.GetMessage(),
@@ -47,7 +47,7 @@ func (s *flasherServerImpl) Flash(req *flasher.FlashRequest, stream flasher.Flas
4747
})
4848
}
4949
extractCB := func(msg *flasher.TaskProgress) {
50-
responseCallback(&flasher.FlashResponse{
50+
_ = responseCallback(&flasher.FlashResponse{
5151
Message: &flasher.FlashResponse_ExtractionProgress{
5252
ExtractionProgress: &flasher.TaskProgress{
5353
Name: msg.GetName(),
@@ -58,7 +58,7 @@ func (s *flasherServerImpl) Flash(req *flasher.FlashRequest, stream flasher.Flas
5858
})
5959
}
6060
flashCB := func(msg *flasher.TaskProgress) {
61-
responseCallback(&flasher.FlashResponse{
61+
_ = responseCallback(&flasher.FlashResponse{
6262
Message: &flasher.FlashResponse_FlashProgress{
6363
FlashProgress: &flasher.TaskProgress{
6464
Name: msg.GetName(),
@@ -101,7 +101,7 @@ func (s *flasherServerImpl) Flash(req *flasher.FlashRequest, stream flasher.Flas
101101
}
102102

103103
tmpZip := paths.New(req.GetTempPath(), "arduino-unoq-debian-image-"+rel.Version+".tar.zst")
104-
defer tmpZip.RemoveAll()
104+
defer func() { _ = tmpZip.RemoveAll() }()
105105

106106
if err := updater.DownloadFile(ctx, tmpZip, rel.Url, rel.Version, downloadCB, downloader.Config{}); err != nil {
107107
return err
@@ -123,7 +123,7 @@ func (s *flasherServerImpl) Flash(req *flasher.FlashRequest, stream flasher.Flas
123123
extractCB(&flasher.TaskProgress{Name: "extract", Completed: true})
124124

125125
imagePath := tmpZip.Parent().Join("arduino-unoq-debian-image-" + rel.Version)
126-
defer imagePath.RemoveAll()
126+
defer func() { _ = imagePath.RemoveAll() }()
127127

128128
flashCB(&flasher.TaskProgress{Name: "flash", Message: "Starting"})
129129
if err := updater.FlashBoard(ctx, imagePath.String(), rel.Version, req.GetPreserveUser()); err != nil {

0 commit comments

Comments
 (0)