Skip to content

Commit fcea13b

Browse files
ardnewgopherbot
authored andcommitted
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: 77a4e86 GitHub-Pull-Request: #489 Reviewed-on: https://go-review.googlesource.com/c/tools/+/580235 Reviewed-by: Joedian Reid <[email protected]> Reviewed-by: Robert Findley <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Tim King <[email protected]> Auto-Submit: Robert Findley <[email protected]>
1 parent b00d49e commit fcea13b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cmd/toolstash/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ func sameObject(file1, file2 string) bool {
423423
log.Fatalf("reading %s: %v", file1, err1)
424424
}
425425
if err2 != nil {
426-
log.Fatalf("reading %s: %v", file2, err1)
426+
log.Fatalf("reading %s: %v", file2, err2)
427427
}
428428
if c1 != c2 {
429429
return false
@@ -450,7 +450,7 @@ func skipVersion(b1, b2 *bufio.Reader, file1, file2 string) bool {
450450
log.Fatalf("reading %s: %v", file1, err1)
451451
}
452452
if err2 != nil {
453-
log.Fatalf("reading %s: %v", file2, err1)
453+
log.Fatalf("reading %s: %v", file2, err2)
454454
}
455455
if c1 != c2 {
456456
return false
@@ -473,7 +473,7 @@ func skipVersion(b1, b2 *bufio.Reader, file1, file2 string) bool {
473473
log.Fatalf("reading %s: %v", file1, err1)
474474
}
475475
if err2 != nil {
476-
log.Fatalf("reading %s: %v", file2, err1)
476+
log.Fatalf("reading %s: %v", file2, err2)
477477
}
478478
if c1 != c2 {
479479
return false

0 commit comments

Comments
 (0)