Skip to content

x/tools/gopls: InlayHint: point out ignored error result #73930

Open
@adonovan

Description

@adonovan

(via HaTS)

Gopls has an analyzer that reports failure to use the result of a call to certain functions. We haven't yet come up with a way to generalize this feature without adding a lot of noisy diagnostics. However, it would be easy to add an (optional) discrete inlay hint showing that an error result has been ignored, as this is often a mistake. (Clearly common functions like fmt.Println would need to be excluded.) For example:

🙈 file.Close()

(That's U+1F648 SEE-NO-EVIL MONKEY. Better ideas welcome.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureRequestIssues asking for a new feature that does not need a proposal.ToolsThis label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions