-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gopls/internal/cache: fix crash in analysis
The "missing Diagnostic.Code" assertion checks an invariant that isn't guaranteed. This change downgrades it to a bug.Reportf. Also, we add a similar assertion to analysistest.RunWithSuggestedFixes which has much better coverage of all the analyzer's different ways of constructing a SuggestedFix, unlike gopl's own superficial tests of each analyzer it carries. (This assertion may be enabled only for analyzers in x/tools, since the invariant is stricter than is required by the public API.) Also, fix a couple of places in unusedvariable where it could conceivably return a fix with no TextEdits; they are not intended to be lazy fixes. Fixes golang/go#65578 Change-Id: I5ed6301b028d184ea896988ca8f210fb8f3dd64f Reviewed-on: https://go-review.googlesource.com/c/tools/+/562397 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Alan Donovan <adonovan@google.com> Commit-Queue: Alan Donovan <adonovan@google.com> Reviewed-by: Robert Findley <rfindley@google.com>
- Loading branch information
Showing
3 changed files
with
38 additions
and
8 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