Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[gopls-release-branch.0.9] internal/lsp/cmd: fix vulncheck error hand…
…ling Fix 1 - print usage info only when appropriate: tool.CommandLineError is a special error that makes a command exits with full usage documentation. When Govulncheck hook runs and fails, it's unlikely the failure was from command line misuse and the extra usage doc will distract users from the root cause. Let's stop that by returning a plain error. Fix 2 - stop printing package loading errors twice: Package loading error was printed by the logger in gopls/internal/vulncheck.cmd and once more by the gopls command line handler. Print it once. For testing, added back the replace statement to go.mod. We will update go.mod back after this commit is merged. Change-Id: Ifaf569a31bbbc84d7b84e1b6d90a8fa0b27ac758 Reviewed-on: https://go-review.googlesource.com/c/tools/+/429515 Reviewed-by: Robert Findley <rfindley@google.com> gopls-CI: kokoro <noreply+kokoro@google.com> Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org>
- Loading branch information