Skip to content

proposal: x/tools/go/analysis/passes/shadow: deprecate it #75342

@adonovan

Description

@adonovan

Background: The shadow analyzer aims to report mistakes related to shadowing of local variables, which is a not infrequent source of mistakes in Go. However, the shadow analyzer has at no point in its history gotten remotely close to the signal-to-noise ratio we expect of our static analysis tools, and that's why it was never enabled by default in the old cmd/vet, nor even included in the vet suite once vet was modularized using the Go analysis framework. Yet we still receive occasional CLs trying to improve the algorithm, and they take time to review.

If anyone wishes to develop their own shadow analyzer, either based on our code or from whole cloth, they are free to do so and we wish them luck; and if they succeed at eliminating false positives (for example, demonstrating a <5% false positive rate on the goalng.org/x repos), we could discuss replacing the current implementation and perhaps even adding it to vet. Until then:

Proposal: We propose to formally deprecate the shadow analyzer on the grounds that it is a failed experiment, and to summarily reject CLs to incrementally improve its algorithm.

@findleyr

Metadata

Metadata

Assignees

No one assigned

    Labels

    ProposalToolProposalIssues describing a requested change to a Go tool or command-line program.

    Type

    No type

    Projects

    Status

    Incoming

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions