1
0
mirror of https://github.com/lxc/incus.git synced 2026-02-05 09:46:19 +01:00

client: Rename variables because error is a builtin interface name

Signed-off-by: karo <karolin.kostial@gmail.com>
This commit is contained in:
karo
2025-04-27 15:40:08 +02:00
parent 52bf3aa932
commit 73c08ac6ff

View File

@@ -164,22 +164,22 @@ type remoteOperationResult struct {
Error error
}
func remoteOperationError(msg string, errors []remoteOperationResult) error {
func remoteOperationError(msg string, errorOperationResults []remoteOperationResult) error {
// Check if empty
if len(errors) == 0 {
if len(errorOperationResults) == 0 {
return nil
}
// Check if all identical
var err error
for _, entry := range errors {
for _, entry := range errorOperationResults {
if err != nil && entry.Error.Error() != err.Error() {
errorStrs := make([]string, 0, len(errors))
for _, error := range errors {
errorStrs = append(errorStrs, fmt.Sprintf("%s: %v", error.URL, error.Error))
errorStrings := make([]string, 0, len(errorOperationResults))
for _, operationResult := range errorOperationResults {
errorStrings = append(errorStrings, fmt.Sprintf("%s: %v", operationResult.URL, operationResult.Error))
}
return fmt.Errorf("%s:\n - %s", msg, strings.Join(errorStrs, "\n - "))
return fmt.Errorf("%s:\n - %s", msg, strings.Join(errorStrings, "\n - "))
}
err = entry.Error