Skip to content

x/tools/go/analysis: running the same analysis with different sets of flags #32155

Open
@dominikh

Description

@dominikh

By convention, analyses are provided as singletons in package variables, a la var Analysis = &analysis.Analyzer{...}. Furthermore, analysis.Analyzer stores a flag.FlagSet for providing options to the analysis. However, this combination of singleton and FlagSet makes it difficult to run one analysis multiple times concurrently with different options. This becomes especially problematic when multiple independent tools coexist in the same address space and want to use the same analysis with different options, as they won't be coordinating with each other.

As far as I am aware, there is no suitable workaround.

/cc @matloob

Metadata

Metadata

Assignees

No one assigned

    Labels

    AnalysisIssues related to static analysis (vet, x/tools/go/analysis)FeatureRequestIssues asking for a new feature that does not need a proposal.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.ToolsThis label describes issues relating to any tools in the x/tools repository.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions