зеркало из https://github.com/golang/tools.git
toolstash: errors output should match errors guarded
The errors guarded against in the `if` conditions are not the errors
printed with`log.Fatalf()` — instead, they are the same errors copied
from the immediately-preceding error checks.
Maybe some sort of copy-paste mistake.
Reasoning:
- The error printed is always `nil` at the changed lines (`err1`).
- The error printed should be a non-`nil` error (`err2`).
Change-Id: I5e4c1e6a460fb37d9d8652b727e641db2245e3c5
GitHub-Last-Rev: 77a4e86342
GitHub-Pull-Request: golang/tools#489
Reviewed-on: https://go-review.googlesource.com/c/tools/+/580235
Reviewed-by: Joedian Reid <joedian@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Tim King <taking@google.com>
Auto-Submit: Robert Findley <rfindley@google.com>
This commit is contained in:
Родитель
b00d49ed93
Коммит
fcea13b66c
|
@ -423,7 +423,7 @@ func sameObject(file1, file2 string) bool {
|
|||
log.Fatalf("reading %s: %v", file1, err1)
|
||||
}
|
||||
if err2 != nil {
|
||||
log.Fatalf("reading %s: %v", file2, err1)
|
||||
log.Fatalf("reading %s: %v", file2, err2)
|
||||
}
|
||||
if c1 != c2 {
|
||||
return false
|
||||
|
@ -450,7 +450,7 @@ func skipVersion(b1, b2 *bufio.Reader, file1, file2 string) bool {
|
|||
log.Fatalf("reading %s: %v", file1, err1)
|
||||
}
|
||||
if err2 != nil {
|
||||
log.Fatalf("reading %s: %v", file2, err1)
|
||||
log.Fatalf("reading %s: %v", file2, err2)
|
||||
}
|
||||
if c1 != c2 {
|
||||
return false
|
||||
|
@ -473,7 +473,7 @@ func skipVersion(b1, b2 *bufio.Reader, file1, file2 string) bool {
|
|||
log.Fatalf("reading %s: %v", file1, err1)
|
||||
}
|
||||
if err2 != nil {
|
||||
log.Fatalf("reading %s: %v", file2, err1)
|
||||
log.Fatalf("reading %s: %v", file2, err2)
|
||||
}
|
||||
if c1 != c2 {
|
||||
return false
|
||||
|
|
Загрузка…
Ссылка в новой задаче