Skip to content

Commit 9e5742b

Browse files
committed
Make linter happy
1 parent 451ca40 commit 9e5742b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Diff for: commands/instances.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -193,22 +193,22 @@ func UpdateLibrariesIndex(ctx context.Context, req *rpc.UpdateLibrariesIndexRequ
193193

194194
// Download gzipped library_index
195195
tmpIndexGz := tmp.Join("library_index.json.gz")
196-
if d, err := downloader.DownloadWithConfig(tmpIndexGz.String(), librariesmanager.LibraryIndexGZURL.String(), *config, downloader.NoResume); err != nil {
197-
return err
198-
} else {
196+
if d, err := downloader.DownloadWithConfig(tmpIndexGz.String(), librariesmanager.LibraryIndexGZURL.String(), *config, downloader.NoResume); err == nil {
199197
if err := Download(d, "Updating index: library_index.json.gz", downloadCB); err != nil {
200198
return errors.Wrap(err, "downloading library_index.json.gz")
201199
}
200+
} else {
201+
return err
202202
}
203203

204204
// Download signature
205205
tmpSignature := tmp.Join("library_index.json.sig")
206-
if d, err := downloader.DownloadWithConfig(tmpSignature.String(), librariesmanager.LibraryIndexSignature.String(), *config, downloader.NoResume); err != nil {
207-
return err
208-
} else {
206+
if d, err := downloader.DownloadWithConfig(tmpSignature.String(), librariesmanager.LibraryIndexSignature.String(), *config, downloader.NoResume); err == nil {
209207
if err := Download(d, "Updating index: library_index.json.sig", downloadCB); err != nil {
210208
return errors.Wrap(err, "downloading library_index.json.sig")
211209
}
210+
} else {
211+
return err
212212
}
213213

214214
// Extract the real library_index
@@ -221,7 +221,7 @@ func UpdateLibrariesIndex(ctx context.Context, req *rpc.UpdateLibrariesIndexRequ
221221
if ok, _, err := security.VerifyArduinoDetachedSignature(tmpIndex, tmpSignature); err != nil {
222222
return errors.Wrap(err, "verifying signature")
223223
} else if !ok {
224-
return errors.New("library_index.json has an invalid signature!")
224+
return errors.New("library_index.json has an invalid signature")
225225
}
226226

227227
// Copy extracted library_index and signature to final destination

0 commit comments

Comments
 (0)