From 1a616939babf6319587b047dc91dd4f816e50c83 Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 8 Aug 2022 14:49:49 -0700 Subject: [PATCH] [skip changelog] Remove spurious argument from error message `github.com/arduino/arduino-cli/i18n.Tr` provides a `fmt.Printf`-style interface, where the first argument may serve as a template filled by subsequent arguments according to its format verbs. This call contains a subsequent argument, but no verb in the format string to use it. This generates some cryptic content in the error message. For example: Error during install: Error downloading tool arduino:bossac@1.7.0-arduino3: no versions available for the current OS%!(EXTRA *cores.ToolRelease=arduino:bossac@1.7.0-arduino3) The tool name is already provided in the correctly configured `Message` field of the error, so there is no need to include it in the `Cause` field as well, so the spurious argument can be removed entirely rather than the alternative fix of adjusting the format string argument. I suspect the spurious argument was simply the result of a copy/paste error. --- arduino/cores/packagemanager/download.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arduino/cores/packagemanager/download.go b/arduino/cores/packagemanager/download.go index 6dfda64fbe6..a45241d9d4f 100644 --- a/arduino/cores/packagemanager/download.go +++ b/arduino/cores/packagemanager/download.go @@ -125,7 +125,7 @@ func (pm *PackageManager) DownloadToolRelease(tool *cores.ToolRelease, config *d if resource == nil { return &arduino.FailedDownloadError{ Message: tr("Error downloading tool %s", tool), - Cause: errors.New(tr("no versions available for the current OS", tool))} + Cause: errors.New(tr("no versions available for the current OS"))} } if err := resource.Download(pm.DownloadDir, config, tool.String(), progressCB); err != nil { return &arduino.FailedDownloadError{