From 8de307b876041b09673da3aaed3306fa61507fde Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Mon, 6 Aug 2018 11:58:06 -0700 Subject: [PATCH] 1-index error messages printed to the console (#1709) The `range` operator returns array indexes that are 0-indexed. This is helpful when working with the computer code, but since we print the error to humans it looks really strange. e.g. ``` error: 7 errors occurred: 0) resource 'urn:pulumi:timer-ex::timer::pulumi:pulumi:Stack::timer-timer-ex' is from a different stack (timer-ex != timer-import) 1) resource 'urn:pulumi:timer-ex::timer::cloud:timer:Timer::test-timer' is from a different stack (timer-ex != timer-import) ... ``` --- pkg/util/cmdutil/exit.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/util/cmdutil/exit.go b/pkg/util/cmdutil/exit.go index 43fcd64e0..ee4fb7e07 100644 --- a/pkg/util/cmdutil/exit.go +++ b/pkg/util/cmdutil/exit.go @@ -135,7 +135,7 @@ func errorMessage(err error) string { } msg := fmt.Sprintf("%d errors occurred:", len(wr)) for i, werr := range wr { - msg += fmt.Sprintf("\n %d) %s", i, errorMessage(werr)) + msg += fmt.Sprintf("\n %d) %s", i+1, errorMessage(werr)) } return msg }