Skip to content

cmd/vet: diagnose set and not used #6072

@rsc

Description

@rsc
If you have:

x := 1
_ = x
x = 2

the spec allows this program and therefore the compilers accept it without comment.

However, it would be nice if vet could tell you about 'set and not used' on the final
line.
Maybe this falls out of some code Alan already has lying around. Maybe not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    AnalysisIssues related to static analysis (vet, x/tools/go/analysis)

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions