-
Notifications
You must be signed in to change notification settings - Fork 17.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/go: replace formatOutput/showOutput with reportCmd
The general pattern is to replace if len(cmdOut) > 0 { output := b.processOutput(cmdOut) if err != nil { err = formatOutput(b.WorkDir, dir, p.ImportPath, desc, output) } else { b.showOutput(a, dir, desc, output) } } if err != nil { return err } with if err := b.reportCmd(a, p, desc, dir, cmdOut, err); err != nil { return err } However, there is a fair amount of variation between call sites. The most common non-trivial variation is sites where errors are an expected outcome. In this case, often we simply pass "nil" for the error to trigger only the printing behavior of reportCmd. For #62067, but also a nice cleanup on its own. Change-Id: Ie5f918017c02d8558f23ad4c38261077c0fa4ea3 Reviewed-on: https://go-review.googlesource.com/c/go/+/529219 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Bryan Mills <bcmills@google.com>
- Loading branch information
Showing
5 changed files
with
68 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters