go/gopls/internal
Hana (Hyang-Ah) Kim 678efe0184 gopls/internal/lsp/cmd: fix vulncheck error handling
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>
Reviewed-on: https://go-review.googlesource.com/c/tools/+/429937
2022-09-12 13:21:00 +00:00
..
coverage gopls: migrate internal/lsp to gopls/internal/lsp 2022-09-07 16:44:44 +00:00
govulncheck gopls/internal/govulncheck: sync x/vuln@62b0186 2022-09-02 15:10:33 +00:00
hooks gopls: migrate internal/lsp to gopls/internal/lsp 2022-09-07 16:44:44 +00:00
lsp gopls/internal/lsp/cmd: fix vulncheck error handling 2022-09-12 13:21:00 +00:00
regtest internal/lsp/fake: add rename file support for testing 2022-09-09 15:30:36 +00:00
vulncheck gopls/internal/lsp/cmd: fix vulncheck error handling 2022-09-12 13:21:00 +00:00
migrate.sh gopls/internal/migrate.sh: a script to migrate internal/lsp to gopls/ 2022-09-07 14:10:36 +00:00