-
Notifications
You must be signed in to change notification settings - Fork 18.3k
Closed
Labels
FrozenDueToAgeToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.
Milestone
Description
Following https://go.dev/issue/60963, we had a discussion around when it is correct to use log.Fatal
, panic
, or bug.Reportf
, when encountering an "impossible" condition in gopls.
Summarizing conclusions:
- If it is at all possible to proceed, use
bug.Reportf
orbug.Errorf
and keep going. (thebug
package was written to allow making gopls incrementally more assertive, without crashing). - If it is impossible to proceed, and the condition is provably impossible, use
log.Fatal
- If it is impossible to proceed, and we can't prove that the condition is impossible, use
panic
(this will allow VS Code crash reporting to capture the stack, among other things).
Action items:
- populate the issue template created by the
gopls bug
subcommand with any bug reports captured in the file cachedon't just write the first bug report to the file cache: write one exemplar per callsite, and (maybe) track a count per callsiteadd a section on error handling to a contributor guide inside the x/tools/gopls/doc directory.To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.
Metadata
Metadata
Labels
FrozenDueToAgeToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.
Type
Projects
Relationships
Development
Select code repository
Activity
gopherbot commentedon Jun 23, 2023
Change https://go.dev/cl/505579 mentions this issue:
gopls/internal/lsp/cmd: list bug reports in 'gopls bug'
gopls/internal/lsp/cmd: list bug reports in 'gopls bug'
gopherbot commentedon Jun 28, 2023
Change https://go.dev/cl/506938 mentions this issue:
gopls/doc/contributing.md: document error handling strategies
gopls/doc/contributing.md: document error handling strategies